Skip to content

Commit d5a2233

Browse files
committed
add test for using stage with a mapping to start only
1 parent 4fbc857 commit d5a2233

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/testthat/test-aes-calculated.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,27 @@ test_that("functions can be masked", {
124124
expect_equal(evaled, list(x = 10, y = 30))
125125

126126
})
127+
128+
test_that("stage allows aesthetics that are only mapped to start", {
129+
130+
df <- data.frame(x = 1:2)
131+
132+
start_unnamed <- aes(stage(x))
133+
expect_equal(
134+
eval_aesthetics(start_unnamed, data = df),
135+
list(x = 1:2)
136+
)
137+
138+
start_named <- aes(stage(start = x))
139+
expect_equal(
140+
eval_aesthetics(start_named, data = df),
141+
list(x = 1:2)
142+
)
143+
144+
start_nulls <- aes(stage(start = x, after_stat = NULL, after_scale = NULL))
145+
expect_equal(
146+
eval_aesthetics(start_nulls, data = df),
147+
list(x = 1:2)
148+
)
149+
150+
})

0 commit comments

Comments
 (0)