tests/testthat/test_isSpecialValue.R

context("isSpecialValue")

test_that("isSpecialValue", {
  p = makeIntegerParam("a", special.vals = list(NULL))
  expect_true(isSpecialValue(p, NULL))
  expect_false(isSpecialValue(p, 1))
  expect_false(isSpecialValue(p, 1.5))
  expect_false(isSpecialValue(p, iris))
  p = makeIntegerParam("a", special.vals = list(iris, 1.5))
  expect_false(isSpecialValue(p, NULL))
  expect_false(isSpecialValue(p, 1))
  expect_true(isSpecialValue(p, 1.5))
  expect_true(isSpecialValue(p, iris))
})

Try the ParamHelpers package in your browser

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

ParamHelpers documentation built on March 26, 2020, 7:40 p.m.