Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Add failing tests to try to confirm a suspected bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew LeSueur committed Dec 4, 2016
1 parent ccfa88b commit 93485be
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions inside_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ func TestRayInside(t *testing.T) {
testRayInside(t, P(1, -0.1), strange, false)
}

func TestRayInside2(t *testing.T) {
normal := []Point{P(0, 0), P(4, 3), P(5, 2), P(0, 0)}
testRayInside(t, P(1, 2), normal, false)
testRayInside(t, P(1, 3), normal, false)
testRayInside(t, P(4, 2), normal, true)
testRayInside(t, P(2, 1), normal, true)
}

var texterior = Polygon{
P(0, 0),
P(0, 6),
Expand Down Expand Up @@ -74,6 +82,10 @@ func TestRayExteriorHoles(t *testing.T) {
{P(8, -3), false},
{P(8, 1), false},
{P(14, -1), false},

{P(8, -0.5), true},
{P(8, -1.5), true},
{P(8, -1), true},
}
// add the edges, all should be inside
for i := 0; i < len(texterior); i++ {
Expand Down

0 comments on commit 93485be

Please sign in to comment.