tests/testthat/test-plot.R

test_that("test result on 'oneAgeTest' plotted correctly", {
  # Load data into environment + prepare data
  data("srilanka")
  res <- calculateAges(srilanka, nloops = 10, seed = 40522)
  res.test <- tests(res, nbmin = 1)
  p <- plot(res.test)
  
  # Test
  expect_equal(class(p), c("gg","ggplot"))
  expect_equal(typeof(p), "list")
})

test_that("test result on 'ageTests' plotted correctly", {
  # Load data into environment + prepare data
  data("srilanka")
  res <- calculateAges(srilanka, nloops = 10, seed = 40522)
  res.test <- tests(res, nbmin = 1, nbmax = 3)
  p <- plot(res.test)
  
  # Test
  expect_equal(class(p), c("gg","ggplot"))
  expect_equal(typeof(p), "list")
})

Try the NiLeDAM package in your browser

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

NiLeDAM documentation built on Sept. 18, 2023, 9:08 a.m.