tests/testthat/test_rgb.r

context('test rgb')

test_that('correct structure', {
  expect_equal(nrow(rgb2hex(rcolor = list('sienna2', 'thistle1'))), 2)
  expect_equal(nrow(rgb2hex(rcolor = list("sienna2", "thistle1"), 
                            rgbcode = list('orange' = c(238, 74, 24),
                                           'raw umber' = c(113, 75, 35)))), 4)
})

test_that("error parsing", {
  expect_error(rgb2hex())
})

Try the highlightHTML package in your browser

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

highlightHTML documentation built on April 21, 2020, 5:06 p.m.