@@ -199,11 +199,11 @@ func TestFindKeys(t *testing.T) {
199199 keys []string
200200 }{
201201 {"" , []string {"a" , "apple" , "applepie" , "arm" , "bee" , "bog" }},
202- {"a" , []string {"a" , "apple" , "applepie" , "arm" }},
202+ {"a" , []string {"a" }},
203203 {"ap" , []string {"apple" , "applepie" }},
204204 {"app" , []string {"apple" , "applepie" }},
205205 {"appl" , []string {"apple" , "applepie" }},
206- {"apple" , []string {"apple" , "applepie" }},
206+ {"apple" , []string {"apple" }},
207207 {"applep" , []string {"applepie" }},
208208 {"applepi" , []string {"applepie" }},
209209 {"applepie" , []string {"applepie" }},
@@ -221,7 +221,7 @@ func TestFindKeys(t *testing.T) {
221221 {"c" , []string {}},
222222 }
223223
224- for _ , c := range cases {
224+ for i , c := range cases {
225225 keys := tree .FindKeys (c .prefix )
226226 match := false
227227 if len (keys ) == len (c .keys ) {
@@ -235,13 +235,13 @@ func TestFindKeys(t *testing.T) {
235235 }
236236
237237 if ! match {
238- t .Errorf ("FindAllValues (\" %s\" ) returned %v, expected %v.\n " ,
239- c .prefix , keys , c .keys )
238+ t .Errorf ("Case %d: FindKeys (\" %s\" ) returned %v, expected %v.\n " ,
239+ i , c .prefix , keys , c .keys )
240240 }
241241 }
242242}
243243
244- func TestFindAll (t * testing.T ) {
244+ func TestFindValues (t * testing.T ) {
245245 entries := []entry {
246246 {"apple" , 1 },
247247 {"applepie" , 2 },
@@ -260,11 +260,11 @@ func TestFindAll(t *testing.T) {
260260 values []any
261261 }{
262262 {"" , []any {3 , 1 , 2 , 4 , 5 }},
263- {"a" , []any {3 , 1 , 2 , 4 }},
263+ {"a" , []any {3 }},
264264 {"ap" , []any {1 , 2 }},
265265 {"app" , []any {1 , 2 }},
266266 {"appl" , []any {1 , 2 }},
267- {"apple" , []any {1 , 2 }},
267+ {"apple" , []any {1 }},
268268 {"applep" , []any {2 }},
269269 {"applepi" , []any {2 }},
270270 {"applepie" , []any {2 }},
@@ -279,7 +279,7 @@ func TestFindAll(t *testing.T) {
279279 {"c" , []any {}},
280280 }
281281
282- for _ , c := range cases {
282+ for i , c := range cases {
283283 values := tree .FindValues (c .key )
284284 match := false
285285 if len (values ) == len (c .values ) {
@@ -293,8 +293,8 @@ func TestFindAll(t *testing.T) {
293293 }
294294
295295 if ! match {
296- t .Errorf ("FindAllValues (\" %s\" ) returned %v, expected %v.\n " ,
297- c .key , values , c .values )
296+ t .Errorf ("Case %d: FindValues (\" %s\" ) returned %v, expected %v.\n " ,
297+ i , c .key , values , c .values )
298298 }
299299 }
300300}
@@ -314,11 +314,11 @@ func TestMatchingChars(t *testing.T) {
314314 {"apple" , "a" , 1 },
315315 {"apple" , "bag" , 0 },
316316 }
317- for _ , c := range cases {
317+ for i , c := range cases {
318318 r := matchingChars (c .s1 , c .s2 )
319319 if r != c .result {
320- t .Errorf ("matchingChars(\" %s\" , \" %s\" ) returned %d, expected %d\n " ,
321- c .s1 , c .s2 , r , c .result )
320+ t .Errorf ("Case %d: matchingChars(\" %s\" , \" %s\" ) returned %d, expected %d\n " ,
321+ i , c .s1 , c .s2 , r , c .result )
322322 }
323323 }
324324}
@@ -351,10 +351,10 @@ func TestDictionary(t *testing.T) {
351351 "diametricall" ,
352352 "diametrically" ,
353353 }
354- for _ , key := range keys {
354+ for i , key := range keys {
355355 _ , err := tree .Find (key )
356356 if err != nil {
357- t .Errorf ("Find(\" %s\" ) encountered error: %v\n " , key , err )
357+ t .Errorf ("Case %d: Find(\" %s\" ) encountered error: %v\n " , i , key , err )
358358 }
359359 }
360360
@@ -365,10 +365,10 @@ func TestDictionary(t *testing.T) {
365365 "de" ,
366366 "dea" ,
367367 }
368- for _ , key := range keys {
368+ for i , key := range keys {
369369 _ , err := tree .Find (key )
370370 if err != ErrPrefixAmbiguous {
371- t .Errorf ("Find(\" %s\" ) should have been ambiguous\n " , key )
371+ t .Errorf ("Case %d: Find(\" %s\" ) should have been ambiguous\n " , i , key )
372372 }
373373 }
374374}
0 commit comments