From ace4f451555b92b4f329ea5f107ecf1749e71c00 Mon Sep 17 00:00:00 2001 From: Derek McQuay Date: Sat, 27 Aug 2016 19:08:51 -0700 Subject: [PATCH] fixed typos and types in all tests --- point_test.go | 6 +++--- rectangle_test.go | 12 ++++++------ triangle_test.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/point_test.go b/point_test.go index c8f384b..659e070 100644 --- a/point_test.go +++ b/point_test.go @@ -19,7 +19,7 @@ func TestDistance(t *testing.T) { actual := distance(rt.p[0], rt.p[1]) if actual != rt.expected { t.Errorf( - "failed spiral:\n\texpected: %d\n\t actual: %d", + "failed distance:\n\texpected: %f\n\t actual: %f", rt.expected, actual, ) @@ -42,7 +42,7 @@ func TestOnLine(t *testing.T) { actual := onLine(rt.p[0], rt.p[1], rt.p[2]) if actual != rt.expected { t.Errorf( - "failed spiral:\n\texpected: %d\n\t actual: %d", + "failed onLine:\n\texpected: %t\n\t actual: %t", rt.expected, actual, ) @@ -65,7 +65,7 @@ func TestLineIntersection(t *testing.T) { actual, _ := lineIntersection(rt.l[0], rt.l[1]) if actual != rt.expected { t.Errorf( - "failed spiral:\n\texpected: %f\n\t actual: %f", + "failed lineIntersection:\n\texpected: %v\n\t actual: %v", rt.expected, actual, ) diff --git a/rectangle_test.go b/rectangle_test.go index 6e66eb6..472501a 100644 --- a/rectangle_test.go +++ b/rectangle_test.go @@ -19,7 +19,7 @@ func TestIsRect(t *testing.T) { actual := rt.r.IsRect() if actual != rt.expected { t.Errorf( - "failed spiral:\n\texpected: %d\n\t actual: %d", + "failed isRect:\n\texpected: %t\n\t actual: %t", rt.expected, actual, ) @@ -44,7 +44,7 @@ func TestSize(t *testing.T) { actual := rt.r.Size() if actual != rt.expected { t.Errorf( - "failed spiral:\n\texpected: %d\n\t actual: %d", + "failed size:\n\texpected: %f\n\t actual: %f", rt.expected, actual, ) @@ -87,7 +87,7 @@ func TestContainment(t *testing.T) { actual := Containment(rt.r[0], rt.r[1]) if actual != rt.expected { t.Errorf( - "failed spiral:\n\texpected: %d\n\t actual: %d", + "failed Containment:\n\texpected: %t\n\t actual: %t", rt.expected, actual, ) @@ -136,7 +136,7 @@ func TestAdjacency(t *testing.T) { actual := Adjacency(rt.r[0], rt.r[1]) if actual != rt.expected { t.Errorf( - "failed spiral:\n\texpected: %d\n\t actual: %d", + "failed adjacency:\n\texpected: %t\n\t actual: %t", rt.expected, actual, ) @@ -173,7 +173,7 @@ func TestIntersection(t *testing.T) { actual := Intersection(rt.r[0], rt.r[1]) if len(actual) != len(rt.expected) { t.Errorf( - "failed spiral:\n\texpected: %d\n\t actual: %d", + "failed intersection:\n\texpected: %d\n\t actual: %d", len(rt.expected), len(actual), ) @@ -182,7 +182,7 @@ func TestIntersection(t *testing.T) { for i, _ := range actual { if actual[i] != rt.expected[i] { t.Errorf( - "failed spiral:\n\texpected: %d\n\t actual: %d", + "failed intersection:\n\texpected: %v\n\t actual: %v", rt.expected[i], actual[i], ) diff --git a/triangle_test.go b/triangle_test.go index 7c59186..cf80b43 100644 --- a/triangle_test.go +++ b/triangle_test.go @@ -15,7 +15,7 @@ func TestSizeTriangle(t *testing.T) { actual := SizeTriangle(rt.pts[0], rt.pts[1], rt.pts[2]) if actual != rt.expected { t.Errorf( - "failed spiral:\n\texpected: %d\n\t actual: %d", + "failed sizeTriangle:\n\texpected: %f\n\t actual: %f", rt.expected, actual, )