@@ -194,20 +194,19 @@ func TestEdgeQueryOptimized(t *testing.T) {
194194 },
195195
196196 {
197- // 1 intermediate face with 1 shape each: addInitialRange covers adequately
197+ // 1 intermediate face with 1 shape each
198198 "faces 0,1,4" ,
199199 []struct { latitude , longitude float64 }{{20 , 20 }, {40 , 90 }, {40 , - 100 }},
200200 },
201201
202202 {
203- // 1 intermediate face but multiple shapes on first face: first top-level cell
204- // doesn't cover all shapes, and addInitialRange misses earlier ones
203+ // 1 intermediate face but multiple shapes on first face
205204 "faces 0,1,4 (3+1+1 shapes)" ,
206205 []struct { latitude , longitude float64 }{{20 , 20 }, {25 , 25 }, {15 , 15 }, {40 , 90 }, {40 , - 100 }},
207206 },
208207
209208 {
210- // 2 intermediate faces: covering too coarse without fix
209+ // 2 intermediate faces
211210 "faces 0,1,3,4" ,
212211 []struct { latitude , longitude float64 }{{20 , 20 }, {40 , 90 }, {0 , 170 }, {40 , - 100 }},
213212 },
@@ -221,7 +220,7 @@ func TestEdgeQueryOptimized(t *testing.T) {
221220 },
222221
223222 {
224- // Non-zero starting face with 1 intermediate: confirms pattern holds
223+ // Non-zero starting face with 1 intermediate
225224 "faces 1,3,4" ,
226225 []struct { latitude , longitude float64 }{{40 , 90 }, {0 , 170 }, {40 , - 100 }},
227226 },
@@ -245,29 +244,29 @@ func TestEdgeQueryOptimized(t *testing.T) {
245244 queryPoint := PointFromLatLng (LatLngFromDegrees (0 , 10 ))
246245
247246 optimized := NewClosestEdgeQueryOptions ().IncludeInteriors (true )
248- resultA := NewClosestEdgeQuery (index , optimized ).FindEdges (
247+ got := NewClosestEdgeQuery (index , optimized ).FindEdges (
249248 NewMinDistanceToPointTarget (queryPoint ),
250249 )
251250
252251 bruteForce := NewClosestEdgeQueryOptions ().IncludeInteriors (true ).UseBruteForce (true )
253- resultB := NewClosestEdgeQuery (index , bruteForce ).FindEdges (
252+ want := NewClosestEdgeQuery (index , bruteForce ).FindEdges (
254253 NewMinDistanceToPointTarget (queryPoint ),
255254 )
256255
257- shapesA , shapesB := make (map [int32 ]bool ), make (map [int32 ]bool )
258- for _ , r := range resultA {
259- shapesA [r .ShapeID ()] = true
256+ shapesGot , shapesWant := make (map [int32 ]bool ), make (map [int32 ]bool )
257+ for _ , r := range got {
258+ shapesGot [r .ShapeID ()] = true
260259 }
261- for _ , r := range resultB {
262- shapesB [r .ShapeID ()] = true
260+ for _ , r := range want {
261+ shapesWant [r .ShapeID ()] = true
263262 }
264263
265- if len (shapesA ) != len (shapesB ) {
264+ if len (shapesGot ) != len (shapesWant ) {
266265 t .Errorf (
267266 "%s: optimized found %d shapes, brute force found %d" ,
268267 test .name ,
269- len (shapesA ),
270- len (shapesB ),
268+ len (shapesGot ),
269+ len (shapesWant ),
271270 )
272271 }
273272 })
0 commit comments