tests/testthat/test-data_verification.R

test_that("Verify Inputs", {
  expect_equal(.verify_input("A", c("A", "B", "C")), "A")
  expect_equal(.verify_input("a", c("A", "B", "C")), "A")
  expect_equal(.verify_input("A", c("a", "b", "c")), "a")

  expect_error(.verify_input("A", c("B", "C")))

  expect_equal(.verify_input(c("B", "A"), c("A", "B", "C")), "B")
  expect_equal(.verify_input(c("D", "A"), c("A", "B", "C")), "A")
})

Try the fChange package in your browser

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

fChange documentation built on June 21, 2025, 9:08 a.m.