We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71fa72c commit 5449109Copy full SHA for 5449109
tests/testthat/test-layer.R
@@ -138,6 +138,22 @@ test_that("layer warns for constant aesthetics", {
138
expect_snapshot_warning(ggplot_build(p))
139
})
140
141
+test_that("layer names can be resolved", {
142
+
143
+ p <- ggplot() + geom_point() + geom_point()
144
+ expect_equal(names(p$layers), c("geom_point", "geom_point...2"))
145
146
+ p <- ggplot() + geom_point(name = "foo") + geom_point(name = "bar")
147
+ expect_equal(names(p$layers), c("foo", "bar"))
148
149
+ l <- geom_point(name = "foobar")
150
+ expect_error(
151
+ p + l + l,
152
+ "names are duplicated"
153
+ )
154
+})
155
156
157
# Data extraction ---------------------------------------------------------
158
159
test_that("AsIs data passes unmodified", {
0 commit comments