tests/testthat/testcolormap.R

library(colormap)

context('Colors')

test_that("Number of Colors match expectation", {
  expect_equal(length(colormap()),72)
  expect_equal(length(colormap(nshades = 10)),10)
  expect_equal(length(colormap(nshades = 3999)),3999)
})

test_that("Reverse works", {
  expect_equal(rev(colormap()), colormap(reverse = T))
})

Try the colormap package in your browser

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

colormap documentation built on May 2, 2019, 10:22 a.m.