tests/testthat/test_colors.R

### Test color functions
context("Color functions")

# Tests -----------------------------------------------------------------------

test_that("commonslib_color returns the correct color for a color name", {
    purrr::map(names(commonslib_colors), function(color_name) {
        expect_equal(
            commonslib_color(color_name),
            unname(commonslib_colors[color_name]))
    })
})
olihawkins/clplot documentation built on March 22, 2020, 8:17 p.m.