tests/testthat/test-order-checks.R

# New checks have to be added to the `order_checks` function in `summarise-checks.R`.
# This test ensures that they are added by failing if not.

test_that ("order checks", {

    pkg_env <- asNamespace ("pkgcheck")
    pkg_fns <- ls (pkg_env)

    fns <- gsub (
        "^output\\_pkgchk\\_", "",
        grep ("^output\\_pkgchk\\_", pkg_fns, value = TRUE)
    )

    checks <- order_checks (fns)

    expect_equal (length (fns), length (checks))
})
ropenscilabs/pkgcheck documentation built on Nov. 24, 2024, 8:31 p.m.