From 2ca4332fb67553bba214269307cff0d509ef7372 Mon Sep 17 00:00:00 2001 From: "Alec L. Robitaille" Date: Fri, 24 Oct 2025 12:43:40 -0300 Subject: [PATCH 1/3] test POINT (0 nan) --- tests/testthat/test-s2-accessors.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/testthat/test-s2-accessors.R b/tests/testthat/test-s2-accessors.R index 19653c54..3f0fe501 100644 --- a/tests/testthat/test-s2-accessors.R +++ b/tests/testthat/test-s2-accessors.R @@ -203,6 +203,9 @@ 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_) }) test_that("s2_max_distance works", { From ecb85c0e5ca040a3fbb46cd75fce3bca55a71c8d Mon Sep 17 00:00:00 2001 From: "Alec L. Robitaille" Date: Fri, 24 Oct 2025 12:47:41 -0300 Subject: [PATCH 2/3] test POINT (nan 0) --- tests/testthat/test-s2-accessors.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testthat/test-s2-accessors.R b/tests/testthat/test-s2-accessors.R index 3f0fe501..aa1033ca 100644 --- a/tests/testthat/test-s2-accessors.R +++ b/tests/testthat/test-s2-accessors.R @@ -206,6 +206,8 @@ test_that("s2_distance works", { 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_) }) test_that("s2_max_distance works", { From e26173105955227e608bcfdd9950efe7f284b34b Mon Sep 17 00:00:00 2001 From: "Alec L. Robitaille" Date: Fri, 24 Oct 2025 12:47:47 -0300 Subject: [PATCH 3/3] test POINT (nan nan) --- tests/testthat/test-s2-accessors.R | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testthat/test-s2-accessors.R b/tests/testthat/test-s2-accessors.R index aa1033ca..527bcd7c 100644 --- a/tests/testthat/test-s2-accessors.R +++ b/tests/testthat/test-s2-accessors.R @@ -208,6 +208,7 @@ test_that("s2_distance works", { 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", {