diff --git a/bugs_test.go b/bugs_test.go index 0785b48..e698566 100644 --- a/bugs_test.go +++ b/bugs_test.go @@ -86,3 +86,16 @@ func TestBug3b(t *T) { t.Errorf("expected %s, got %s", exp, result) } } + +func TestBug3c(t *T) { + subject := polyclip.Polygon{{{1, 2}, {2, 2}, {2, 1}}} + clipping := polyclip.Polygon{ + {{1, 2}, {2, 3}, {2, 2}}, + {{2, 2}, {2, 3}, {3, 2}}} + result := dump(subject.Construct(polyclip.UNION, clipping)) + + exp := dump(polyclip.Polygon{{{1, 2}, {2, 3}, {3, 2}, {2, 2}, {2, 1}}}) + if result != exp { + t.Errorf("expected %s, got %s", exp, result) + } +}