diff --git a/r/geoarrow/R/handle.R b/r/geoarrow/R/handle.R index 25e10f2c..9601ab51 100644 --- a/r/geoarrow/R/handle.R +++ b/r/geoarrow/R/handle.R @@ -1,5 +1,5 @@ -geoarrow_handle_wk <- function(x, handler, size = NA_integer_) { +geoarrow_handle <- function(x, handler, size = NA_integer_) { stream <- as_geoarrow_array_stream(x) handler <- wk::as_wk_handler(handler) diff --git a/r/geoarrow/tests/testthat/test-handle.R b/r/geoarrow/tests/testthat/test-handle.R index ba5f03ec..f8d85537 100644 --- a/r/geoarrow/tests/testthat/test-handle.R +++ b/r/geoarrow/tests/testthat/test-handle.R @@ -1,4 +1,22 @@ -test_that("wk handler works", { - geoarrow_handle_wk(wk::xy(0, 1), wk::wk_debug_filter()) +test_that("handler works on geoarrow.point", { + expect_identical( + geoarrow_handle(wk::xy(0:1999, 1:2000), wk::xy_writer()), + wk::xy(0:1999, 1:2000) + ) + + expect_identical( + geoarrow_handle(wk::xyz(0, 1, 2), wk::xy_writer()), + wk::xyz(0, 1, 2) + ) + + expect_identical( + geoarrow_handle(wk::xym(0, 1, 3), wk::xy_writer()), + wk::xym(0, 1, 3) + ) + + expect_identical( + geoarrow_handle(wk::xyzm(0, 1, 2, 3), wk::xy_writer()), + wk::xyzm(0, 1, 2, 3) + ) })