tests/testthat/test-nav_input.R

test_that("input", {
  mn <- new_nav_input(c("key1", "key2", "key3"), as.list(letters[1:3])) |>
    itemise(key2 = letters,
            key3 = LETTERS)

  expect_equal(mn$value[mn$key == "key2"][[1]], letters)
  expect_equal(mn$value[mn$key == "key3"][[1]], LETTERS)

  expect_output(print(mn), "key1")
  expect_output(print(mn), "key2")
  expect_output(print(mn), "key3")
})

Try the navigatr package in your browser

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

navigatr documentation built on March 31, 2023, 9:42 p.m.