From 69871f161eef5aaa3349607f5dadc2bab5ceeaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Czapli=C4=B9=E2=80=9Eski?= Date: Thu, 9 Oct 2014 00:21:25 +0200 Subject: [PATCH] add one more test related to issue #3 --- bugs_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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) + } +}