tests/testthat/tests.R

context("Fac")

test_that("Fac catches gamma", {
  expect_message(Fac(5.5, gamma = FALSE))
})

test_that("Fac of zero gives 1", {
  expect_equal(Fac(0), 1)
  expect_equal(Fac(0, gamma = FALSE), 1)
})

context("hello")

test_that("hello to you too", {
  expect_equal(hello(), "Hello, world!")
})
OleksF/mytestpackage_R documentation built on May 7, 2019, 9:03 p.m.