From cccc2e84da0e66428f42668d8d72a96dd1111f90 Mon Sep 17 00:00:00 2001 From: Andy Teucher Date: Mon, 23 Mar 2020 08:36:40 -0700 Subject: [PATCH] Don't test specifics of crs output. #103 --- tests/testthat/test-utils.R | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index ddd6173..e0a6f31 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -55,12 +55,11 @@ test_that("NA values dealt with in sf_to_GeoJSON", { sf::st_as_sfc(c("POINT(0 0)", "POINT(1 1)")) ) geojson <- sf_to_GeoJSON(sf_obj) - expect_equal(geojson, - structure("{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"a\":1},\"geometry\":{\"type\":\"Point\",\"coordinates\":[0,0]}},{\"type\":\"Feature\",\"properties\":{\"a\":null},\"geometry\":{\"type\":\"Point\",\"coordinates\":[1,1]}}]}", - class = "json", proj = structure(list( - epsg = NA_integer_, proj4string = NA_character_ - ), class = "crs") - ) + expect_equivalent(geojson, + structure( + "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"a\":1},\"geometry\":{\"type\":\"Point\",\"coordinates\":[0,0]}},{\"type\":\"Feature\",\"properties\":{\"a\":null},\"geometry\":{\"type\":\"Point\",\"coordinates\":[1,1]}}]}", + class = "json" + ) ) back_to_sf <- GeoJSON_to_sf(geojson, proj = attr(geojson, "proj")) expect_equivalent(sf_obj, back_to_sf)