tests/testthat/test-random_integer_from_real.R

r <- 0.8


test_that("function returns correct values and class type", {
  expect_equal(r %% 1, 0.8)
  expect_equal(ceiling(r), 1)
  expect_length(r, 1)
  expect_type(floor(r), "double")
  expect_type(ceiling(r), "double")
  expect_true(r < 1)
  expect_is(r, "numeric")
})

Try the ascotraceR package in your browser

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

ascotraceR documentation built on Dec. 20, 2021, 5:07 p.m.