Commit 01d4b752 authored by santiaago's avatar santiaago
Browse files

test left2ndTriangle

parent 4742a85c
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -44,3 +44,20 @@ func TestLeft1stTriangle(t *testing.T) {
		}
	}
}

func Testleft2ndTriangle(t *testing.T) {

	x1, y1, x2, y2, x3, y3 := left2ndTriangle(0, 0, 2, 4)
	got := []int{x1, y1, x2, y2, x3, y3}
	expected := []int{4, 1, 0, 2, 4, 3}

	if len(got) != len(expected) {
		t.Errorf("lengths of arrays should be equal")
	}

	for k, _ := range got {
		if got[k] != expected[k] {
			t.Errorf("expected %d got %d on element #%d", expected[k], got[k], k)
		}
	}
}