Skip to content

Commit dc8566f

Browse files
committed
add test that values are retained along with metadata
1 parent 855a5e3 commit dc8566f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/testthat/test-tar-terra-rast.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,13 @@ tar_test("metadata is maintained", {
143143
r
144144
}
145145
list(
146-
tar_terra_rast(r, make_rast())
146+
tar_terra_rast(r, make_rast()),
147+
tar_terra_rast(r2, make_rast(), preserve_metadata = "drop")
147148
)
148149
})
149150
tar_make()
150151
x <- tar_read(r)
151152
expect_equal(terra::units(x), rep("m", 3))
152153
expect_equal(terra::time(x), as.Date("2024-10-01") + c(0, 1, 2))
154+
expect_equal(head(terra::values(x)), head(terra::values(tar_read(r2))))
153155
})

0 commit comments

Comments
 (0)