tests/testthat/test-makeItemsScale.R

## Unit tests for makeItemsScale() function

test_that("makeItemsScale runs silently with valid inputs", {
  ## define parameters

  lowerbound <- 1
  upperbound <- 5
  items <- 4

  myvalues <- c((lowerbound * items):(upperbound * items))

  ## apply function test

  expect_no_warning(makeItemsScale(
    scale = myvalues,
    lowerbound = lowerbound,
    upperbound = upperbound,
    items = items
  ))
})

Try the LikertMakeR package in your browser

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

LikertMakeR documentation built on June 8, 2025, 9:39 p.m.