Skip to content

Commit fc3aaf3

Browse files
committed
add test
1 parent 85762f8 commit fc3aaf3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/testthat/test-coord-polar.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,18 @@ test_that("radial coords can be reversed", {
197197
expect_equal(as.numeric(fwd$y), rev(as.numeric(rev$y)))
198198
})
199199

200+
test_that("coord_radial can deal with empty breaks (#6271)", {
201+
p <- ggplot_build(
202+
ggplot(mtcars, aes(mpg, disp)) +
203+
geom_point() +
204+
coord_radial() +
205+
scale_x_continuous(breaks = numeric()) +
206+
scale_y_continuous(breaks = numeric())
207+
)
208+
guides <- p$layout$panel_params[[1]]$guides$guides
209+
is_none <- vapply(guides, inherits, logical(1), what = "GuideNone")
210+
expect_true(all(is_none))
211+
})
200212

201213
# Visual tests ------------------------------------------------------------
202214

0 commit comments

Comments
 (0)