Skip to content
Snippets Groups Projects
Commit 1ad42c42 authored by Alec L. Robitaille's avatar Alec L. Robitaille :sunflower:
Browse files

add test that original NAs remain after make_grid

parent 075764cc
Branches
Tags
1 merge request!11Feature/make binary
......@@ -12,7 +12,6 @@ test_that("make_binary works", {
expect_equal(res(lc), res(lc212))
expect_error(make_binary(),
'layer must be provided.')
......@@ -28,4 +27,14 @@ test_that("make_binary works", {
expect_error(make_binary(lc, c(212, 212)),
'value must be of length one.')
})
test_that('make_binary handles NA', {
buf <- st_buffer(points[1,], 1e2)
mlc <- mask(crop(lc, buf), buf, inverse = TRUE)
expect_true(NA %in% raster::unique(mlc, na.last = TRUE))
expect_true(NA %in% raster::unique(make_binary(mlc, 212), na.last = TRUE))
})
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment