Skip to content

Commit

Permalink
simplified variant of issue #3, for easier debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
akavel committed Oct 8, 2014
1 parent 2becc43 commit 08844ca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bugs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,18 @@ func TestBug3(t *T) {
t.Errorf("expected %s, got %s", exp, result)
}
}

// somewhat simplified variant, for easier debugging
func TestBug3b(t *T) {
subject := polyclip.Polygon{{{1, 2}, {2, 2}, {2, 1}}}
clipping := polyclip.Polygon{
{{2, 1}, {2, 2}, {3, 2}},
{{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, 1}}})
if result != exp {
t.Errorf("expected %s, got %s", exp, result)
}
}

0 comments on commit 08844ca

Please sign in to comment.