Skip to content

Commit

Permalink
restrict CRS equality testing to epsg and proj4string; #1146
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Nov 29, 2019
1 parent a74ffe4 commit 006b5b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test_crs.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ test_that("st_crs works", {
nc2 = st_read(system.file("shape/nc.shp", package="sf"), "nc", quiet = TRUE)
nc3 = st_read(system.file("shape/nc.shp", package="sf"), "nc", crs = NA, quiet = TRUE)
crs_4267 <- st_crs(4267)
expect_equal(st_crs(nc2), crs_4267)
expect_equal(st_crs(nc2)[1:2], crs_4267[1:2])
expect_equal(st_crs(nc3), NA_crs_)
expect_equal(st_set_crs(nc3, 4267) %>% st_crs, crs_4267)
expect_equal(nc1, nc2)
expect_equal(nc1[1:2], nc2[1:2])

expect_warning(st_crs(nc2) <- 3857, "replacing crs does not reproject data")
expect_silent(st_crs(nc2) <- 3857)
Expand Down

0 comments on commit 006b5b8

Please sign in to comment.