tests/_helper/ref-objs/translate/testthat/test-translate2.R

# for translate unitizer tests

set.seed(1)
context("testthat to unitizer")

# random non-sectioned

expect_equal(rev(10:1), 1:10)        # blah blah

test_that("simple tests", {
  expect_equal(fun0(a), 1:10)        # first internal
  expect_equal(
    fun1(a, b, c, d, e, f), # internal comment
    runif(20)
  )   # "external" comment
  expect_true(fun1(a))
})
# a test for errors

test_that("errors", {
  # Making up sections

  expect_error(stop("hello"))
  expect_warning(warning("yoyo"))
})
# Cause error

test_that("Nested test_that", {
  test_that("Inner test_that", TRUE)
} )

Try the unitizer package in your browser

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

unitizer documentation built on Oct. 8, 2023, 5:06 p.m.