Skip to content

Commit

Permalink
cover gridDisk too large exception
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacbrodsky committed Dec 26, 2022
1 parent 20367dc commit c91e6be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/java/com/uber/h3core/TestTraversal.java
Expand Up @@ -80,6 +80,13 @@ public void testKringLarge() {
assertEquals(expectedCount, hexagons.size());
}

@Test(expected = IllegalArgumentException.class)
public void testKringTooLarge() {
int k = 13780510;
// Cannot be materialized into Java because the maximum array size is INT32_MAX
h3.gridDisk(h3.latLngToCell(0, 0, 15), k);
}

@Test
public void testKringPentagon() {
List<String> hexagons = h3.gridDisk("821c07fffffffff", 1);
Expand Down

0 comments on commit c91e6be

Please sign in to comment.