Skip to content

Add $polygon tests#192

Open
PatersonProjects wants to merge 8 commits into
documentdb:mainfrom
PatersonProjects:polygon_tests
Open

Add $polygon tests#192
PatersonProjects wants to merge 8 commits into
documentdb:mainfrom
PatersonProjects:polygon_tests

Conversation

@PatersonProjects
Copy link
Copy Markdown
Contributor

@PatersonProjects PatersonProjects commented May 15, 2026

The PR adds the tests for the $polygon geospatial specifier, and one additional error case test for geoWithin generally

Issue: Ref #32

PatersonProjects and others added 6 commits May 14, 2026 16:37
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…verlaps

Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels May 15, 2026
@documentdb-triage-tool
Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort L · Status In Progress
Confidence: 0.82 (mixed)

Reasoning

component from path globs (test-coverage); effort from diff stats (1215+0 LOC, 8 files); LLM: Adds new test cases for the $polygon geospatial specifier, expanding compatibility test coverage for an existing tracked feature.

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

Copy link
Copy Markdown
Collaborator

@vic-tsang vic-tsang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edge Cases:

  • Point located exactly on a polygon vertex
  • Point collinear with an edge but beyond the segment
  • Point on a non-axis-aligned edge (e.g., midpoint of hypotenuse)

Errors:

  • $polygon: [[0,0,0],[1,1,1],[2,0,0]] | 3-element points — error or silently ignored?
  • $polygon: [[], [], []] | Empty sub-arrays as points
  • Multiple shape specifiers in one $geoWithin
  • $polygon: [[0,0],[1,1],[NaN,NaN],[2,0]] | Error even if most points are valid
  • [[-Inf, 0], [1,1], [2,0]] | Only positive Infinity tested

Others:

  • embedded_doc_non_xy_keys | {"a":1, "b":2} — does it use first two fields as x/y? Behavior is non-obvious
    = a test case with $not + $polygon

Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
@PatersonProjects
Copy link
Copy Markdown
Contributor Author

Edge Cases:

  • Point located exactly on a polygon vertex
  • Point collinear with an edge but beyond the segment
  • Point on a non-axis-aligned edge (e.g., midpoint of hypotenuse)

Errors:

  • $polygon: [[0,0,0],[1,1,1],[2,0,0]] | 3-element points — error or silently ignored?
  • $polygon: [[], [], []] | Empty sub-arrays as points
  • Multiple shape specifiers in one $geoWithin
  • $polygon: [[0,0],[1,1],[NaN,NaN],[2,0]] | Error even if most points are valid
  • [[-Inf, 0], [1,1], [2,0]] | Only positive Infinity tested

Others:

  • embedded_doc_non_xy_keys | {"a":1, "b":2} — does it use first two fields as x/y? Behavior is non-obvious
    = a test case with $not + $polygon

Added missing cases, put the multiple specifiers test within the geoWithin suite, it did not have a matching case and the behaviour is not polygon specific.

@PatersonProjects PatersonProjects marked this pull request as ready for review May 19, 2026 22:42
@PatersonProjects PatersonProjects requested a review from a team as a code owner May 19, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants