Skip to content

Commit 6c60bac

Browse files
committed
add test
1 parent d37e8dc commit 6c60bac

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/testthat/test-scales.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,17 @@ test_that("Discrete scales with only NAs return `na.value`", {
731731
expect_equal(sc$map(x), c(NA_real_, NA_real_))
732732
})
733733

734+
test_that("continuous scales warn about faulty `limits`", {
735+
expect_error(
736+
scale_x_continuous(limits = c("A", "B")),
737+
"not a character vector"
738+
)
739+
expect_error(
740+
scale_x_continuous(limits = 1:3),
741+
"length 2, not length 3"
742+
)
743+
})
744+
734745
test_that("discrete scales work with NAs in arbitrary positions", {
735746
# Prevents intermediate caching of palettes
736747
map <- function(x, limits) {

0 commit comments

Comments
 (0)