From 16e844cf1c721b8a2fad648456f58c1ad6114c11 Mon Sep 17 00:00:00 2001 From: gaspardle Date: Sun, 7 Feb 2016 22:29:57 -0500 Subject: [PATCH] Safer float comparison in relation test --- test/route_relation_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/route_relation_test.go b/test/route_relation_test.go index 89b796c..ae7a587 100644 --- a/test/route_relation_test.go +++ b/test/route_relation_test.go @@ -2,7 +2,7 @@ package test import ( "database/sql" - + "math" "testing" "github.com/omniscale/imposm3/geom/geos" @@ -60,7 +60,7 @@ func TestRouteRelation_MemberGeomUpdated1(t *testing.T) { t.Fatal(rows) } g := ts.g.FromWkt(rows[0]["wkt"]) - if g.Length() != 111.32448543701321 { + if math.Abs(g.Length() - 111.32448543701321) > 0.00000001 { t.Fatal(g.Length()) } @@ -87,7 +87,7 @@ func TestRouteRelation_MemberGeomUpdated2(t *testing.T) { t.Fatal(rows) } g := ts.g.FromWkt(rows[0]["wkt"]) - if g.Length() != 184.97560221624542 { + if math.Abs(g.Length() - 184.97560221624542) > 0.00000001 { t.Fatal(g.Length()) }