Skip to content

Commit

Permalink
add some tests for NodeId and NodeIdList
Browse files Browse the repository at this point in the history
  • Loading branch information
d-callan committed Jan 22, 2024
1 parent 28543cb commit b2948bd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/testthat/test-nodes.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
test_that("NodeId works", {
expect_equal(class(NodeId('A'))[1], 'NodeId')
})

test_that("NodeIdList works", {
expect_equal(class(NodeIdList(list(NodeId('A'), NodeId('B'))))[1], 'NodeIdList')
expect_equal(class(NodeIdList(list('A', 'B')))[1], 'NodeIdList')
expect_equal(class(NodeIdList(list(Node(id=NodeId('A')))))[1], 'NodeIdList')
expect_equal(class(NodeIdList(Node(id=NodeId('A'))))[1], 'NodeIdList')
expect_equal(class(NodeIdList(list(Node(id=NodeId('A')), Node(id=NodeId('B')))))[1], 'NodeIdList')

expect_error(NodeIdList(S4Vectors::SimpleList(c(NodeId('A'), 'B'))))
expect_error(NodeIdList(S4Vectors::SimpleList(c('A', 'B'))))
})

test_that("Node methods work", {

# Create a node
Expand Down

0 comments on commit b2948bd

Please sign in to comment.