tests/testthat/test_check_cft.R

context("Check Counterfactual")

test_that("Checking check_cft",{
  
  #Check that counterfactual decreases exposure levels
  expect_warning({
    X   <- rnorm(100,4,1)
    cft <- function(X){2*X}
    check.cft(cft, X)
  })
  
  expect_equal({
    X   <- rnorm(100,4,1)
    cft <- function(X){0.5*X}
    check.cft(cft, X)
  }, TRUE)
  
})

Try the pifpaf package in your browser

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

pifpaf documentation built on May 1, 2019, 9:11 p.m.