tests/testthat/test-scale_fill_hcl.R

test_that("hcl.colors work", {
  expect_equal(hcl.colors(5),
               c("#4B0055", "#00588B", "#009B95",
                 "#53CC67", "#FDE333"))
})

test_that("scale_fill_hc work", {
  df <- data.frame(x = 1:5, y = c(1, 2, 3, 4, 5))

  p <- ggplot(df, aes(x, y))+
    geom_horizon()+
    scale_fill_hcl()

  expect_snapshot(layer_data(p)$fill)
})

Try the ggHoriPlot package in your browser

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

ggHoriPlot documentation built on Oct. 11, 2022, 5:07 p.m.