Skip to content

Commit 6b8f59e

Browse files
committed
test: add Q shape assertions to rdp test
1 parent 846ae44 commit 6b8f59e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test_simplify.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ def test_ramer_douglas_peucker():
1414
S, J, Q = ramer_douglas_peucker(points, threshold=0.5)
1515
assert len(S) <= len(points)
1616
assert len(S) >= 2 # At least start and end points
17+
# Q maps each original point to simplified curve - same length as input
18+
assert len(Q) == len(points)
19+
assert len(Q[0]) == 3 # Each Q entry is a 3D point
1720
# With zero threshold, should keep all points
1821
S2, J2, Q2 = ramer_douglas_peucker(points, threshold=0.0)
1922
assert len(S2) == len(points)

0 commit comments

Comments
 (0)