Skip to content

Commit

Permalink
hex api cov
Browse files Browse the repository at this point in the history
  • Loading branch information
dcooley committed Nov 8, 2020
1 parent 1a7a1ec commit fb0cfd6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/testthat/test-api.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,27 @@ test_that("hex api covered",{
x = list(letters[1:5]), palette = mat_pal, alpha = 255.0, n_summaries = 3, format = FALSE
)

res_lst3 <- colourvalues:::rcpp_colour_values_hex(
x = list(letters[1:5]), palette = mat_pal, alpha = 255.0, n_summaries = 0, format = FALSE
)

expect_equal( res_lst4, )

expect_equal( res_lst1$summary_colours, res_lst2$summary_colours )
expect_equal( res_lst1$colours, res_lst2$colours )
expect_equal( res_lst1$colours, res_lst )
expect_null( res_lst3$summary_values )

res <- colourvalues:::rcpp_colour_values_hex(
x = lst_nv, palette = mat_pal, alpha = 255.0, summary = TRUE, format = FALSE
)

res2 <- colourvalues:::rcpp_colour_values_hex(
x = lst_nv, palette = str_pal, alpha = 255.0, n_summaries = 5, format = FALSE
)

expect_equal( res, res2 )

expect_equal(
res$colours[[1]]
, colour_values(nv, n_summaries = 5, format = FALSE)$colours
Expand All @@ -82,4 +96,5 @@ test_that("hex api covered",{
)



})

0 comments on commit fb0cfd6

Please sign in to comment.