tests/testthat/context.R

context("First context.")

test_that("Logical equivalence", {
  x <- TRUE
  expect_equal(x, TRUE)
})

test_that("Numerical equivalence", {
  x <- 1
  expect_equal(x, 1)
})

context("Second context.")

test_that("A passing test", {
  expect_equal(TRUE, TRUE)
})

test_that("A failing test", {
  expect_equal(TRUE, FALSE)
})

Try the testthat package in your browser

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

testthat documentation built on May 29, 2024, 9:38 a.m.