tests/testthat/test_utils.R

context("Utility functions")

test_that("Multiplicative series only if x are all positive", {
    expect_true(is_multiplicative(1:10, TRUE))
    expect_false(is_multiplicative(1:10, FALSE))
    expect_warning(expect_false(is_multiplicative(-100:-50, TRUE)))
    expect_warning(expect_false(is_multiplicative(-50:50, TRUE)))
})

test_that("Leap year function returns the correct value", {
    expect_true(is.leapyear(2020))
    expect_false(is.leapyear(2019))
})

Try the iNZightTS package in your browser

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

iNZightTS documentation built on Feb. 1, 2022, 1:08 a.m.