tests/testthat/test-colorblind.R

test_that("colorblind_pal works", {
  p <- colorblind_pal()
  expect_type(p, "closure")
  expect_hexcolor(p(4))
  expect_type(attr(p, "max_n"), "integer")
})

test_that("colorblind_pal raises warning with to large n", {
  expect_warning(colorblind_pal()(20))
})

test_that("scale_colour_colorblind works", {
  expect_s3_class(scale_colour_colorblind(), "ScaleDiscrete")
})

test_that("scale_color_canva works", {
  expect_equal(scale_color_colorblind(), scale_colour_colorblind())
})

test_that("scale_fill_colorblind works", {
  expect_s3_class(scale_fill_colorblind(), "ScaleDiscrete")
})

Try the ggthemes package in your browser

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

ggthemes documentation built on Nov. 21, 2023, 5:08 p.m.