Skip to content

Commit 58aaf50

Browse files
committed
Add unit tests for empty sf
1 parent 50ea199 commit 58aaf50

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/testthat/test-normalize-2.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ class(do.call(rbind, unclass(st_geometry(ptsdata))) %>% st_multipoint()) # XY,
6868

6969
expect_maps_equal(p1, p2)
7070

71+
(p4 <- leaflet() %>% addTiles() %>% addCircleMarkers(data = ptsdata[FALSE,]))
72+
(p5 <- leaflet() %>% addTiles() %>% addCircleMarkers(data = st_geometry(ptsdata)[FALSE]))
73+
(p6 <- leaflet() %>% addTiles() %>% addCircleMarkers(lng = numeric(0), lat = numeric(0)))
74+
expect_maps_equal(p4, p5)
75+
expect_maps_equal(p4, p6)
7176

7277
### lines -----------------------------------------------------------------
7378
create_square <- function(width = 2, lng = 0, lat = 0, hole = FALSE, type = Polygon) {

0 commit comments

Comments
 (0)