Skip to content

Commit

Permalink
One more hull test
Browse files Browse the repository at this point in the history
  • Loading branch information
platypii committed Dec 4, 2023
1 parent 449f2c7 commit 4121054
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/modeling/src/operations/hulls/hull.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ test('hull (multiple, overlapping, geom3)', (t) => {
t.is(pts.length, 92)
})

test('hull (multiple, with undefined/null values)', (t) => {
test('hull (multiple with undefined/null values)', (t) => {
const square1 = square({ size: 4 })
const square2 = square({ size: 6 })
const square3 = square({ size: 8 })
Expand All @@ -306,3 +306,16 @@ test('hull (multiple, with undefined/null values)', (t) => {
t.is(measureArea(obs), 64)
t.is(pts.length, 4)
})

test('hull (multiple with nested arrays)', (t) => {
const square1 = square({ size: 4 })
const square2 = square({ size: 6 })
const square3 = square({ size: 8 })
const geometries = [square1, [square2, [square3]]]

const obs = hull(...geometries)
const pts = geom2.toPoints(obs)
t.notThrows(() => geom2.validate(obs))
t.is(measureArea(obs), 64)
t.is(pts.length, 4)
})

0 comments on commit 4121054

Please sign in to comment.