File: test-examples.R

package info (click to toggle)
r-cran-testthat 3.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,048 kB
  • sloc: cpp: 9,269; sh: 14; ansic: 14; makefile: 5
file content (9 lines) | stat: -rw-r--r-- 299 bytes parent folder | download
1
2
3
4
5
6
7
8
9
test_that("test_examples works with installed packages", {
  local_mocked_bindings(test_rd = identity)
  expect_true(length(test_examples()) > 1)
})

test_that("test_examples fails if no examples", {
  withr::local_envvar(TESTTHAT_PKG = "")
  expect_snapshot(error = TRUE, test_examples("asdf"))
})