File: test-test-example.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 (15 lines) | stat: -rw-r--r-- 417 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
test_that("can test documentation from path or Rd object", {
  rd_path <- test_path("../../man/expect_length.Rd")
  skip_if_not(file.exists(rd_path))

  capture_output({
    test_example(rd_path)
    test_rd(tools::parse_Rd(rd_path))
  })
})
test_that("returns false if no examples", {
  rd_path <- test_path("../../man/test_examples.Rd")
  skip_if_not(file.exists(rd_path))

  expect_false(test_example(rd_path))
})