Skip to content

Commit 27e655a

Browse files
committed
fix R CMD check error
1 parent 9aa186c commit 27e655a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/testthat/test-geom-sf.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,13 @@ test_that("geom_sf() handles alpha properly", {
120120
g <- get_layer_grob(p)[[1]]
121121

122122
# alpha affects the colour of points and lines
123-
expect_equal(g[[1]]$gp$col, alpha(red, 0.5))
124-
expect_equal(g[[2]]$gp$col, alpha(red, 0.5))
123+
# geom_sf() will use `gList()` which is not a grob
124+
# and will be wrapped into a `gTree()`.
125+
expect_equal(g$children[[1]]$gp$col, alpha(red, 0.5))
126+
expect_equal(g$children[[2]]$gp$col, alpha(red, 0.5))
125127
# alpha doesn't affect the colour of polygons, but the fill
126-
expect_equal(g[[3]]$gp$col, alpha(red, 1.0))
127-
expect_equal(g[[3]]$gp$fill, alpha(red, 0.5))
128+
expect_equal(g$children[[3]]$gp$col, alpha(red, 1.0))
129+
expect_equal(g$children[[3]]$gp$fill, alpha(red, 0.5))
128130
})
129131

130132
test_that("errors are correctly triggered", {

0 commit comments

Comments
 (0)