tests/testthat/test-function-stopIfNotAllColumnsFound.R

test_that("stopIfNotAllColumnsFound() works", {

  f <- kwb.utils:::stopIfNotAllColumnsFound

  expect_error(f())

  columnDescription <- list(
    x = list(match = "^x", colNumber = integer()),
    y = list(match = "^y", colNumber = 2)
  )
  
  expect_error(f(columnDescription, c("a", "y")))

  # TODO: why does this not pass?
  #expect_silent(f(columnDescription, c("x1", "y2")))
})
KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.