tests/testthat/test-Node.R

test_that("incorrect label types are rejected", {
  n1 <- Node$new("n1")
  expect_identical(n1$label(), "n1")
  expect_error(Node$new(42L), class = "non-string_label")
  expect_error(Node$new(TRUE), class = "non-string_label")
})

test_that("node type is returned", {
  n1 <- Node$new()
  expect_identical(n1$type(), "Node")
})

Try the rdecision package in your browser

Any scripts or data that you put into this service are public.

rdecision documentation built on June 22, 2024, 10:02 a.m.