Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 11, 2018
1 parent e547e31 commit 6db66c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Imports:
units (>= 0.6-0),
utils
Suggests:
blob,
covr,
dplyr (>= 0.7-0),
ggplot2,
Expand Down
11 changes: 11 additions & 0 deletions tests/testthat/test_wkb.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,14 @@ test_that("Reading of truncated buffers results in a proper error", {
expect_error(st_as_sfc(wkb, EWKB = TRUE), "WKB buffer too small. Input file corrupt?")
})

test_that("st_as_sfc() honors crs argument", {
raw = st_as_binary(st_point(c(26e5, 12e5)))

list = list(raw)
blob = blob::blob(raw)
wkb = as_wkb(list)

expect_identical(st_as_sfc(raw, crs = 2056), st_as_sfc(wkb, crs = 2056))
expect_identical(st_as_sfc(list, crs = 2056), st_as_sfc(wkb, crs = 2056))
expect_identical(st_as_sfc(blob, crs = 2056), st_as_sfc(wkb, crs = 2056))
})

0 comments on commit 6db66c7

Please sign in to comment.