Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Sep 16, 2024
1 parent 961a33f commit 5c3ec37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/testthat/test-position-stack.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ test_that("negative and positive values are handled separately", {

expect_equal(dat$ymin[dat$x == 2], c(0, -3))
expect_equal(dat$ymax[dat$x == 2], c(2, 0))

# Test only negatives #6088
df <- data_frame0(x = c(1, 1, 2, 2), y = c(-1, -1, -1, -1), g = LETTERS[1:4])
dat <- get_layer_data(ggplot(df, aes(x, y, fill = factor(g))) + geom_col())
expect_equal(dat$ymax, dat$ymin + 1)
expect_equal(dat$ymin, c(-2, -1, -2, -1))
})

test_that("can request reverse stacking", {
Expand Down

0 comments on commit 5c3ec37

Please sign in to comment.