Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions man/scale_viridis.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions tests/testthat/test-scales.r
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,15 @@ test_that("scale_apply preserves class and attributes", {
expect_false(inherits(out, "foobar"))
expect_null(attributes(out))
})

test_that("All scale_colour_*() have their American versions", {
# In testthat, the package env contains non-exported functions as well so we
# need to parse NAMESPACE file by ourselves
exports <- readLines(system.file("NAMESPACE", package = "ggplot2"))
colour_scale_exports <- grep("export\\(scale_colour_.*\\)", exports, value = TRUE)
color_scale_exports <- grep("export\\(scale_color_.*\\)", exports, value = TRUE)
expect_equal(
colour_scale_exports,
sub("color", "colour", color_scale_exports)
)
})