Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jul 10, 2021
1 parent ac0c1c2 commit f9d3bc6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/trans-set.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void wk_trans_set_finalize(void* trans_data) {

SEXP wk_c_trans_set_new(SEXP xy, SEXP use_z, SEXP use_m) {
if (Rf_xlength(xy) != 4 || TYPEOF(xy) != VECSXP) {
Rf_error("`xy` must be an xyzm() object");
Rf_error("`xy` must be an xyzm() object"); // # nocov
}

// prepare data for C struct / validate args
Expand Down
13 changes: 13 additions & 0 deletions tests/testthat/test-set.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ test_that("wk_trans_set() is vectorized", {
)
})

test_that("wk_trans_set() can set ZM values at the same time", {
expect_identical(
wk_handle(
wkt("POINT (0 0)"),
wk_transform_filter(
wkt_writer(),
wk_trans_set(xyzm(NA, NA, 1, 2), use_z = TRUE, use_m = TRUE)
)
),
wkt("POINT ZM (0 0 1 2)")
)
})

test_that("wk_trans_set() can set XY values", {
expect_identical(
wk_handle(
Expand Down

0 comments on commit f9d3bc6

Please sign in to comment.