Skip to content

Commit 481cbe1

Browse files
committed
add test
1 parent acdeae4 commit 481cbe1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/testthat/test-scale-colour.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,22 @@ test_that("palette arguments can take alternative input", {
4949
expect_equal(alpha(test, 1), hex)
5050

5151
})
52+
53+
test_that("`name` is directed correctly (#6623)", {
54+
# The desired behaviour is that the first argument passed to scales is the
55+
# 'name' argument.
56+
57+
scales <- list(
58+
scale_colour_continuous,
59+
scale_colour_discrete,
60+
scale_colour_binned,
61+
scale_fill_continuous,
62+
scale_fill_discrete,
63+
scale_fill_binned
64+
)
65+
66+
for (scale in scales) {
67+
p <- scale("foobar")
68+
expect_equal(p$name, "foobar")
69+
}
70+
})

0 commit comments

Comments
 (0)