@@ -21,11 +21,11 @@ test_that("negative and positive values are handled separately", {
21
21
p <- ggplot(df , aes(x , y , fill = factor (g ))) + geom_col()
22
22
dat <- layer_data(p )
23
23
24
- expect_equal(dat $ ymin [dat $ x == 1 ], c(- 1 , 0 , 1 ))
25
- expect_equal(dat $ ymax [dat $ x == 1 ], c(0 , 1 , 2 ))
24
+ expect_equal(dat $ ymin [dat $ x == 1 ], c(0 , - 1 , 1 ))
25
+ expect_equal(dat $ ymax [dat $ x == 1 ], c(1 , 0 , 2 ))
26
26
27
- expect_equal(dat $ ymin [dat $ x == 2 ], c(- 3 , 0 ))
28
- expect_equal(dat $ ymax [dat $ x == 2 ], c(0 , 2 ))
27
+ expect_equal(dat $ ymin [dat $ x == 2 ], c(0 , - 3 ))
28
+ expect_equal(dat $ ymax [dat $ x == 2 ], c(2 , 0 ))
29
29
})
30
30
31
31
test_that(" can request reverse stacking" , {
@@ -36,7 +36,7 @@ test_that("can request reverse stacking", {
36
36
p <- ggplot(df , aes(1 , y , fill = g )) +
37
37
geom_col(position = position_stack(reverse = TRUE ))
38
38
dat <- layer_data(p )
39
- expect_equal(dat $ ymin , c(- 2 , - 3 , 0 , 2 ))
39
+ expect_equal(dat $ ymin , c(- 2 , 0 , - 3 , 2 ))
40
40
})
41
41
42
42
test_that(" data with no extent is stacked correctly" , {
0 commit comments