Expand poly test coverage: closing segment, repeated vertex, tolerance#30
Open
gistrec wants to merge 1 commit into
Open
Expand poly test coverage: closing segment, repeated vertex, tolerance#30gistrec wants to merge 1 commit into
gistrec wants to merge 1 commit into
Conversation
- Re-enable the commented-out contains() cases for the pole queried at longitude 180 — both pass in geodesic and rhumb modes. - Cover the only behavioral difference between on_edge and on_path: a point lying solely on the implicit closing segment of a polygon. - Cover zero-length segments (repeated vertex) including the sin_delta_bearing denom <= 0 branch, and meters semantics of the tolerance parameter with a non-default value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test-only PR closing coverage gaps found during a library review. No library changes.
LatLng(90, 180)cases incontainstests (pole queried at longitude 180, previously commented out) — verified passing in both geodesic and rhumb modes.on_edgeandon_path— the implicit closing segment — was untested for polygons of ≥3 vertices. New mirrored tests use a triangle whose closing edge runs along the equator (where great-circle and Rhumb paths coincide):on_edgefinds a point on it,on_pathdoes not.denom <= 0branch ofsin_delta_bearing); degenerate two-identical-point polyline behaves like a single point.tolerance— a point ~900.7 m off an equator segment is rejected at 500 m and accepted at 1000 m, in both modes.All expectations were verified against the current implementation before being committed (no characterization of buggy behavior — the new cases are mode-independent by construction).
Test plan
tests/poly/contains.hppdo not overlap with Fix contains() for polygon edges spanning exactly 180° of longitude #29 — both PRs merge independently