tests/testthat/test-statistic.R

# Testing 'Statistic' class.

test_that("'Statistic' base class throws errors for abstract methods", {
    # Create `Statistic` base class.
    statistic <- Statistic$new()

    # Expect error because the methods are abstract.
    expect_error(statistic$compute(NULL), .__ERRORS__$not_implemented)
    expect_error(statistic$apply(NULL), .__ERRORS__$not_implemented)
})

Try the powerly package in your browser

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

powerly documentation built on Sept. 9, 2022, 5:07 p.m.