Skip to content

Commit 26c71c5

Browse files
committed
Test formatting of sf geometry columns
'sf' is one of the few packages that uses a list column in a data.frame with a correctly working format() method. Since we disregard such methods now, test that the correct behaviour still happens thanks to the format() methods of the individual list items.
1 parent 5a1468f commit 26c71c5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

inst/tests/other.Rraw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ test(14.2, {example('CJ', package='data.table', local=TRUE, echo=FALSE); TRUE})
220220
if (loaded[["sf"]]) { #2273
221221
DT = as.data.table(st_read(system.file("shape/nc.shp", package = "sf"), quiet=TRUE))
222222
test(15, DT[1:3, .(NAME, FIPS, geometry)], output="Ashe.*-81.4.*Surry.*-80.4")
223+
test(15.1, DT, output="MULTIPOLYGON (((") # make sure individual list items are formatted, #6637, #5224
223224

224225
dsf = sf::st_as_sf(data.table(x=1:10, y=1:10, s=sample(1:2, 10, TRUE)), coords=1:2)
225226
test(16, split(dsf, dsf$s), list(`1` = dsf[dsf$s == 1, ], `2` = dsf[dsf$s == 2, ]))

0 commit comments

Comments
 (0)