tests/testthat/test-show_example.R

test_that("show_example returns an example", {
  constant("hello") %>% show_example() %>% expect_equal("hello")
})

test_that("show_example can show empty vectors", {
  constant(integer(length = 0L)) %>% show_example() %>% expect_equal(integer(0))
  constant(list()) %>% show_example() %>% expect_equal(list())
})

Try the quickcheck package in your browser

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

quickcheck documentation built on Oct. 12, 2023, 1:08 a.m.