tests/testthat/test-theme_tgam.R

test_that('tgam_cols has 10 colours', {
  expect_length(tgam_cols(), 10)
})

test_that('tgam_cols returns the graphics palettes', {
  expect_equal(tgam_colors %in% tgam_cols(), rep(TRUE, 10))
})

test_that('tgam_pal interpolates properly for both palettes', {
  expect_match(tgam_pal()(1), '#852E57')
  expect_match(tgam_pal(palette = 'alternate')(1), '#2D5783')
})

Try the tgamtheme package in your browser

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

tgamtheme documentation built on Feb. 5, 2021, 5:06 p.m.