tests/testthat/test-colors.R

test_that("palette creation works", {
  expect_equal(length(delfi_palette('Diverging')), 3)
  expect_equal(length(delfi_palette('Categorical')), 5)
})

test_that("palette > max n outputs max n w/ message", {
  expect_equal(length(delfi_palette('Diverging', 5)), 3)
})

test_that("interpolation works", {
  expect_equal(length(delfi_palette('Categorical', type = 'continuous', n = 80)), 80)
})
ggraham/delfiVisID documentation built on Jan. 12, 2022, 12:24 a.m.