Skip to content

Commit

Permalink
tests: add test case from Java bug report
Browse files Browse the repository at this point in the history
  • Loading branch information
grim7reaper committed May 11, 2024
1 parent 9f2061b commit a129be4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/api/geom/to_cells.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,22 @@ fn issue_23() {
assert_eq!(count, 218_375);
}

// https://github.com/uber/h3-java/issues/138
#[test]
fn bug_h3_java_138() {
let poly = polygon![
(x:11.147991,y:64.758157),
(x:11.443969,y:64.758157),
(x:11.443969,y:64.845147),
(x:11.147991,y:64.845147)
];
let shape = Polygon::from_degrees(poly).unwrap();
let config = PolyfillConfig::new(Resolution::Ten)
.containment_mode(ContainmentMode::ContainsCentroid);
let count = shape.to_cells(config).count();
assert_eq!(count, 14_697);
}

macro_rules! cell {
($x: expr) => {{
CellIndex::try_from($x).expect("valid cell")
Expand Down

0 comments on commit a129be4

Please sign in to comment.