Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestguevarra committed Mar 9, 2024
1 parent 3c97c0d commit ecef053
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/testthat/test-create_palette.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ testthat::expect_equal(length(xx), 5)

testthat::expect_warning(create_palette_qualitative(8, "dark"))
testthat::expect_warning(create_palette_qualitative(9, "pastel"))
testthat::expect_warning(create_palette_qualitative(6, "innovative"))
testthat::expect_error(create_palette_qualitative(5, "blues"))

xx <- create_brewer_palette(n = 7, name = "blues", type = "sequential")

testthat::expect_s3_class(xx, class = "palette")
testthat::expect_equal(length(xx), 7)

xx <- create_brewer_palette(n = 7, name = "brbg", type = "divergent")

testthat::expect_s3_class(xx, class = "palette")
testthat::expect_equal(length(xx), 7)

0 comments on commit ecef053

Please sign in to comment.