From 838ca04868c2dd1b2be65038e660f19822d9b83a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 14 Aug 2024 11:57:00 +0200 Subject: [PATCH] test(edge_distances): fix assertion The fixture for this test case is confusing, it seems to 'want' `false` but actually it is being ignored and the test is assertion for `true`. --- s2/edge_distances_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/s2/edge_distances_test.go b/s2/edge_distances_test.go index 4a3c37f..046e194 100644 --- a/s2/edge_distances_test.go +++ b/s2/edge_distances_test.go @@ -202,26 +202,26 @@ func TestEdgeDistancesUpdateMinInteriorDistanceRejectionTestIsConservative(t *te a: Point{r3.Vector{1, -8.9031850507928352e-11, 0}}, b: Point{r3.Vector{-0.99999999999996347, 2.7030110029169596e-07, 1.555092348806121e-99}}, minDist: minDist, - want: false, + want: true, }, { x: Point{r3.Vector{1, -4.7617930898495072e-13, 0}}, a: Point{r3.Vector{-1, -1.6065916409055676e-10, 0}}, b: Point{r3.Vector{1, 0, 9.9964883247706732e-35}}, minDist: minDist, - want: false, + want: true, }, { x: Point{r3.Vector{1, 0, 0}}, a: Point{r3.Vector{1, -8.4965026896454536e-11, 0}}, b: Point{r3.Vector{-0.99999999999966138, 8.2297529603339328e-07, 9.6070344113320997e-21}}, minDist: minDist, - want: false, + want: true, }, } for _, test := range tests { - if _, ok := UpdateMinDistance(test.x, test.a, test.b, test.minDist); !ok { + if _, ok := UpdateMinDistance(test.x, test.a, test.b, test.minDist); ok != test.want { t.Errorf("UpdateMinDistance(%v, %v, %v, %v) = %v, want %v", test.x, test.a, test.b, test.minDist, ok, test.want) } }