mirror of
https://github.com/agdamsbo/stRoke.git
synced 2024-11-22 13:00:23 +01:00
12 lines
423 B
R
12 lines
423 B
R
# Unit test for contrast_text()
|
|
|
|
library(testthat)
|
|
|
|
test_that("contrast_text() returns the correct text color", {
|
|
expect_equal(contrast_text("#FFFFFF"), "black")
|
|
expect_equal(contrast_text("#000000"), "white")
|
|
expect_equal(contrast_text("#FFFFFF", light_text="blue", dark_text="green"),
|
|
"green")
|
|
expect_equal(contrast_text("#000000", light_text="blue", dark_text="green"),
|
|
"blue")
|
|
}) |