diff --git a/tests/testthat/test-s2-accessors.R b/tests/testthat/test-s2-accessors.R index 19653c54..527bcd7c 100644 --- a/tests/testthat/test-s2-accessors.R +++ b/tests/testthat/test-s2-accessors.R @@ -203,6 +203,12 @@ test_that("s2_distance works", { expect_identical(s2_distance(NA_character_, "POINT (0 0)"), NA_real_) expect_identical(s2_distance("POINT (0 0)", "POINT EMPTY"), NA_real_) expect_identical(s2_distance("POINT EMPTY", "POINT (0 0)"), NA_real_) + + expect_identical(s2_distance("POINT (0 nan)", "POINT (0 0)"), NA_real_) + expect_identical(s2_distance("POINT (0 0)", "POINT (0 nan)"), NA_real_) + expect_identical(s2_distance("POINT (nan 0)", "POINT (0 0)"), NA_real_) + expect_identical(s2_distance("POINT (0 0)", "POINT (nan 0)"), NA_real_) + expect_identical(s2_distance("POINT (nan nan)", "POINT (nan nan)"), NA_real_) }) test_that("s2_max_distance works", {