tests/testthat/test-qlq_c30.R

context("qlq_c30 testing")


set.seed(8675309)
dat <- PROscorerTools::makeFakeData(n = 50, nitems = 30, values = 1:4)


test_that("qlq_c30: Error if both 'iprefix' and 'items' given", {
  expect_error(qlq_c30(df = dat, iprefix = "q", items = 1:30),
               "use either the 'iprefix' or 'items'")
})


## These tests are causing problems with CRAN checks.
## I cannot reproduce, so I am commenting out these tests for now.

test_that("qlq_c30: Expect no error (silent) when correct input given", {
  expect_silent(qlq_c30(df = dat, iprefix = "q"))
  expect_silent(qlq_c30(df = dat, items = 1:30))
  expect_silent(qlq_c30(df = dat, items = 1:30, keepNvalid = TRUE))
})

Try the PROscorer package in your browser

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

PROscorer documentation built on Oct. 17, 2023, 1:06 a.m.