tests/testthat/testvalue.R

library(indyr)
context("Numbers OK")

test_that("answers are correct",{
  expect_equal(sq(10), 10^2)
  expect_equal(sq(20), 20^2)
  expect_equal(RP(3, 3), 3^3)
  expect_equal(RP(2, 4), 2^4)
  expect_equal(RP(NA, 10), NA_integer_)
  expect_less_than(roll(1:20), 2*20 + 1)
  #expect_more_than(roll(), 1)
  #expect_that(roll(dietype = 1:6), gives_warning("standard dice"))
  #expect_that(roll(dietype = 21:26), gives_warning("non-standard dice"))
})
jungd/indyr documentation built on May 20, 2019, 4:24 a.m.