Skip to content

test(geom): cover negative half ties and clarify touching holes - #2184

Closed
giswqs wants to merge 1 commit into
mainfrom
test/sweep-geometry-fixtures-2026-11-15
Closed

giswqs wants to merge 1 commit into
mainfrom
test/sweep-geometry-fixtures-2026-11-15

Conversation

@giswqs

@giswqs giswqs commented Nov 15, 2026

Copy link
Copy Markdown
Member

Summary

Pin the negative half-tie area-formatting behavior and correct the triangulation fixture comment: the hole touches the left edge at points without sharing an edge.

Release quality points: negative half-tie, touching-hole fixture.

Testing

Formatting and diff checks passed. cargo test -p rustgis-geom is running; long checks continue in CI. Local validation uses GDAL 3.13.3.

UI evidence

No visible UI change.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6b2c42cc-b132-4b9f-abae-aa9ea767fe2c
Commits

Reviewing files that changed from the base of the PR and between ce40749 and 3f1fecf.

Files selected for processing: 2

  • crates/geom/src/lib.rs
  • crates/geom/src/triangulate.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

let inner = vec![vec![(1.0, 1.0), (2.0, 1.0), (2.0, 2.0), (1.0, 2.0)]];
assert!(!triangulate_reporting(&sq, &inner).unwrap().1);
// A hole that stays clear of the left side is fine.
// A hole touching the left side at points, without sharing an edge, is fine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment is wrong about the fixture (confidence: high). The hole (0,1), (2,2), (0,3) has its closing edge (0,3)→(0,1) on x = 0, which is the square's left side. So the hole shares a 2-unit segment with the outer ring; it does not touch "at points without sharing an edge". The assertion (not fanned) is pre-existing and unchanged, so the test still checks the shared-segment case. The PR body's stated purpose is the points-only case, which this fixture does not exercise. Suggested wording that matches what the test checks:

Suggested change
// A hole touching the left side at points, without sharing an edge, is fine.
// A hole sharing part of the left side, from (0,1) to (0,3), is not fanned.

If the points-only case is what you want covered, it needs a separate fixture whose hole vertices sit on x = 0 without a hole edge between them.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs

  • crates/geom/src/triangulate.rs:192: the new comment says the fixture's hole touches the left side "at points, without sharing an edge". It does share one. The hole's closing edge runs from (0,3) to (0,1) along x=0, which is the square's left side, so the test covers the shared-segment case. The assertion itself was already there and is unchanged. Confidence: high. Inline comment posted with a suggested rewording.

Security

  • None found.

Performance

  • None found.

Quality

  • crates/geom/src/lib.rs:1742: the new format_area(-0.5) assertion is correct. (-0.5).abs().round() is 1.0, so the < 1e6 branch runs. format!("{:.0}", -0.5) yields "-0" under Rust's round-half-to-even, which the existing -0 guard maps to "0 m²". The assertion depends on that rounding behaviour, which the test documents. Confidence: medium-high. I did not run the tests because I have no shell here.

AGENTS.md

  • No violations found. The change is test-only, adds no user-visible strings, and touches no saved format, command or background path.

Prior reviews: none on this PR, so nothing was skipped as already raised.

Change size

Compared: the whole PR against main (merge base ce40749 to PR head 3f1fecf).

Measure Value
Files changed 2 (0 added, 2 modified, 0 removed, 0 renamed)
Size before 106.9 KB
Size after 106.9 KB
Total size change +73 B
Path Before After Change
crates/geom/src/lib.rs 95.7 KB 95.8 KB +48 B
crates/geom/src/triangulate.rs 11.1 KB 11.1 KB +25 B

@giswqs

giswqs commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Superseded by the combined release-quality PR #2196 so these related fixes can be reviewed together.

@giswqs giswqs closed this Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant