inst/examples/test-failure.R

plus <- function(x, y) 1 + 1

test_that("one plus one is two", {
  expect_equal(plus(1, 1), 2)
})

test_that("two plus two is four", {
  expect_equal(plus(2, 2), 4)
})

Try the testthat package in your browser

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

testthat documentation built on Jan. 21, 2022, 1:10 a.m.