tests/testthat/test-is_odd.R

context("is.odd")

test_that("is.odd use", {
  expect_true(is.odd(1))
  expect_false(is.odd(0))
})

test_that("is.odd abuse",{
  expect_error(is.odd("nonsense"), "'x' should be a number")
  expect_error(is.odd(NA), "'x' should be a number")
  expect_error(is.odd(NULL), "'x' should be a number")
  expect_error(is.odd(1.2), "'x' should be a whole number")
})
xieshu95/Trait_dependent_TraiSIE documentation built on Nov. 22, 2019, 7:51 a.m.