Skip to content

Commit a3019f9

Browse files
Regenerate document and add a test to ensure no missing scale_color_*() (#4134)
* Regenerate document * Add a test to confirm no missing scale_color_* * Fix regex pattern
1 parent 4a8c827 commit a3019f9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

man/scale_viridis.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-scales.r

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,15 @@ test_that("scale_apply preserves class and attributes", {
370370
expect_false(inherits(out, "foobar"))
371371
expect_null(attributes(out))
372372
})
373+
374+
test_that("All scale_colour_*() have their American versions", {
375+
# In testthat, the package env contains non-exported functions as well so we
376+
# need to parse NAMESPACE file by ourselves
377+
exports <- readLines(system.file("NAMESPACE", package = "ggplot2"))
378+
colour_scale_exports <- grep("export\\(scale_colour_.*\\)", exports, value = TRUE)
379+
color_scale_exports <- grep("export\\(scale_color_.*\\)", exports, value = TRUE)
380+
expect_equal(
381+
colour_scale_exports,
382+
sub("color", "colour", color_scale_exports)
383+
)
384+
})

0 commit comments

Comments
 (0)