Skip to content

Commit fdc1156

Browse files
committed
s2: fix edge_distances 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`.
1 parent 6adc566 commit fdc1156

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

s2/edge_distances_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,26 +202,26 @@ func TestEdgeDistancesUpdateMinInteriorDistanceRejectionTestIsConservative(t *te
202202
a: Point{r3.Vector{1, -8.9031850507928352e-11, 0}},
203203
b: Point{r3.Vector{-0.99999999999996347, 2.7030110029169596e-07, 1.555092348806121e-99}},
204204
minDist: minDist,
205-
want: false,
205+
want: true,
206206
},
207207
{
208208
x: Point{r3.Vector{1, -4.7617930898495072e-13, 0}},
209209
a: Point{r3.Vector{-1, -1.6065916409055676e-10, 0}},
210210
b: Point{r3.Vector{1, 0, 9.9964883247706732e-35}},
211211
minDist: minDist,
212-
want: false,
212+
want: true,
213213
},
214214
{
215215
x: Point{r3.Vector{1, 0, 0}},
216216
a: Point{r3.Vector{1, -8.4965026896454536e-11, 0}},
217217
b: Point{r3.Vector{-0.99999999999966138, 8.2297529603339328e-07, 9.6070344113320997e-21}},
218218
minDist: minDist,
219-
want: false,
219+
want: true,
220220
},
221221
}
222222

223223
for _, test := range tests {
224-
if _, ok := UpdateMinDistance(test.x, test.a, test.b, test.minDist); !ok {
224+
if _, ok := UpdateMinDistance(test.x, test.a, test.b, test.minDist); ok != test.want {
225225
t.Errorf("UpdateMinDistance(%v, %v, %v, %v) = %v, want %v", test.x, test.a, test.b, test.minDist, ok, test.want)
226226
}
227227
}

0 commit comments

Comments
 (0)