Skip to content

Commit fbbb2cc

Browse files
committed
test on random boundary
1 parent cb1de20 commit fbbb2cc

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/compas/datastructures/test_halfedge.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import random
23

34
import compas
45

@@ -334,3 +335,26 @@ def test_loops_and_strips_open_corner(grid):
334335
assert edge in loop
335336
assert len(loop) == 10
336337
assert edge == loop[-1]
338+
339+
340+
def test_loops_and_strips_open_boundary(grid):
341+
assert grid.number_of_edges() == 220
342+
343+
edge = random.choice(grid.edges_on_boundary())
344+
u, v = edge
345+
346+
loop = grid.edge_loop(edge)
347+
strip = grid.edge_strip(edge)
348+
349+
assert edge in strip
350+
assert len(strip) == 11
351+
assert grid.is_edge_on_boundary(* strip[0])
352+
assert grid.is_edge_on_boundary(* strip[-1])
353+
354+
assert edge in loop
355+
assert len(loop) == 10
356+
357+
if grid.halfedge[u][v] is None:
358+
assert edge == strip[-1]
359+
else:
360+
assert edge == strip[0]

0 commit comments

Comments
 (0)