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"))
})

Try the gsDesign package in your browser

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

gsDesign documentation built on June 8, 2025, 1:49 p.m.