tests/testthat/test-internals.R

test_that("Errors are thrown when they should", {
    skip_on_cran()
    
    expect_error(projections:::assert_reporting("asasd"),
                 "reporting is not numeric")
    
    expect_error(projections:::assert_reporting(Inf),
                 "reporting is not a finite value")

    expect_error(projections:::assert_reporting(NA_integer_),
                 "reporting is not a finite value")
    
    expect_error(projections:::assert_reporting(0),
                 "reporting <= 0")
    
    expect_error(projections:::assert_reporting(-123),
                 "reporting <= 0")
    
    expect_error(projections:::assert_reporting(1.1),
                 "reporting > 1")
    
})

Try the projections package in your browser

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

projections documentation built on March 31, 2023, 7:18 p.m.