init
This commit is contained in:
commit
116abafc09
58 changed files with 5749 additions and 0 deletions
34
tests/testthat/test-colors.R
Normal file
34
tests/testthat/test-colors.R
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
test_that("pmColors creates correct structure", {
|
||||
colors <- pmColors(earth = "#d3d3d3", water = "#1a3a5c")
|
||||
|
||||
expect_equal(colors$earth, "#d3d3d3")
|
||||
expect_equal(colors$water, "#1a3a5c")
|
||||
})
|
||||
|
||||
test_that("pmColors expands park to park_a and park_b", {
|
||||
colors <- pmColors(park = "#00ff00")
|
||||
|
||||
expect_equal(colors$park_a, "#00ff00")
|
||||
expect_equal(colors$park_b, "#00ff00")
|
||||
})
|
||||
|
||||
test_that("pmColors expands wood to wood_a and wood_b", {
|
||||
colors <- pmColors(wood = "#228b22")
|
||||
|
||||
expect_equal(colors$wood_a, "#228b22")
|
||||
expect_equal(colors$wood_b, "#228b22")
|
||||
})
|
||||
|
||||
test_that("pmColors expands minor to minor_a and minor_b", {
|
||||
colors <- pmColors(minor = "#ffffff")
|
||||
|
||||
expect_equal(colors$minor_a, "#ffffff")
|
||||
expect_equal(colors$minor_b, "#ffffff")
|
||||
})
|
||||
|
||||
test_that("pmColors passes through additional properties", {
|
||||
colors <- pmColors(earth = "#ccc", custom_prop = "#abc")
|
||||
|
||||
expect_equal(colors$earth, "#ccc")
|
||||
expect_equal(colors$custom_prop, "#abc")
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue