@@ -33,23 +33,23 @@ test_that("geom_sf() determines the legend type automatically", {
3333
3434 # test the automatic choice
3535 expect_identical(fun_geom_sf(mp , TRUE )$ plot $ layers [[1 ]]$ show.legend , TRUE )
36- expect_identical(fun_geom_sf(mp , TRUE )$ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
36+ expect_identical(fun_geom_sf(mp , TRUE )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
3737
3838 expect_identical(fun_geom_sf(mls , TRUE )$ plot $ layers [[1 ]]$ show.legend , TRUE )
39- expect_identical(fun_geom_sf(mls , TRUE )$ plot $ layers [[1 ]]$ geom_params $ legend , " line" )
39+ expect_identical(fun_geom_sf(mls , TRUE )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " line" )
4040
4141 expect_identical(fun_geom_sf(mpol , TRUE )$ plot $ layers [[1 ]]$ show.legend , TRUE )
42- expect_identical(fun_geom_sf(mpol , TRUE )$ plot $ layers [[1 ]]$ geom_params $ legend , " polygon" )
42+ expect_identical(fun_geom_sf(mpol , TRUE )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " polygon" )
4343
4444 # test that automatic choice can be overridden manually
4545 expect_identical(fun_geom_sf(mp , " point" )$ plot $ layers [[1 ]]$ show.legend , TRUE )
46- expect_identical(fun_geom_sf(mp , " point" )$ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
46+ expect_identical(fun_geom_sf(mp , " point" )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
4747
4848 expect_identical(fun_geom_sf(mls , " point" )$ plot $ layers [[1 ]]$ show.legend , TRUE )
49- expect_identical(fun_geom_sf(mls , " point" )$ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
49+ expect_identical(fun_geom_sf(mls , " point" )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
5050
5151 expect_identical(fun_geom_sf(mpol , " point" )$ plot $ layers [[1 ]]$ show.legend , TRUE )
52- expect_identical(fun_geom_sf(mpol , " point" )$ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
52+ expect_identical(fun_geom_sf(mpol , " point" )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
5353})
5454
5555test_that(" geom_sf() determines the legend type from mapped geometry column" , {
@@ -70,19 +70,19 @@ test_that("geom_sf() determines the legend type from mapped geometry column", {
7070 p <- ggplot_build(
7171 ggplot(d_sf ) + geom_sf(aes(geometry = g_point , colour = " a" ))
7272 )
73- expect_identical(p $ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
73+ expect_identical(p $ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
7474
7575 p <- ggplot_build(
7676 ggplot(d_sf ) + geom_sf(aes(geometry = g_line , colour = " a" ))
7777 )
78- expect_identical(p $ plot $ layers [[1 ]]$ geom_params $ legend , " line" )
78+ expect_identical(p $ plot $ layers [[1 ]]$ computed_geom_params $ legend , " line" )
7979
8080 # If `geometry` is not a symbol, `LayerSf$setup_layer()` gives up guessing
8181 # the legend type, and falls back to "polygon"
8282 p <- ggplot_build(
8383 ggplot(d_sf ) + geom_sf(aes(geometry = identity(g_point ), colour = " a" ))
8484 )
85- expect_identical(p $ plot $ layers [[1 ]]$ geom_params $ legend , " polygon" )
85+ expect_identical(p $ plot $ layers [[1 ]]$ computed_geom_params $ legend , " polygon" )
8686})
8787
8888test_that(" geom_sf() removes rows containing missing aes" , {
0 commit comments