tests/testthat/test-check-scalar-hasDimnames.R

test_that("hasDimnames", {
    skip_if_not_installed("datasets")
    for (fun in list(
        hasDimnames,
        hasRownames,
        hasColnames
    )) {
        x <- datasets::mtcars
        expect_true(fun(x))
        x <- data.frame()
        ok <- fun(x)
        expect_false(ok)
        expect_s4_class(ok, "goalie")
    }
})
steinbaugh/goalie documentation built on Jan. 17, 2024, 5:16 p.m.