tests/testthat/test-independent-test-checkScalar.R

# Test checkScalar function
#----------------------------------------------

testthat::test_that("Test checkScalar for invalid value for isType", code = {
  x <- 5
  testthat::expect_error(checkScalar(x, isType = 12),
    info = "Test checkScalar for invalid range"
  )
})


testthat::test_that("Test checkScalar with valid value", code = {
  x <- 5
  testthat::expect_invisible(checkScalar(x, isType = "numeric"))
})
keaven/gsDesign documentation built on April 11, 2025, 4:23 p.m.