File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ func Normalize(s string) string {
21
21
),
22
22
strings .ToLower (s ),
23
23
); err == nil {
24
- return r
24
+ s = r
25
25
}
26
26
27
27
return s
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ func TestNormalize(t *testing.T) {
21
21
})
22
22
}
23
23
}
24
+
24
25
func TestInSlice (t * testing.T ) {
25
26
tts := []struct {
26
27
name string
@@ -279,3 +280,22 @@ func TestListForHumans(t *testing.T) {
279
280
})
280
281
}
281
282
}
283
+
284
+ func TestIsSimilar (t * testing.T ) {
285
+ tts := [][]string {
286
+ {"similar" , "similar" },
287
+ {"some long string" , "Some Long STRING" },
288
+ {"atencao" , "Atenção" },
289
+ {"it should've this kind of keep \" stuff\" " ,
290
+ "It should've this kind of keep \" STUFF\" " },
291
+ }
292
+
293
+ for i := range tts {
294
+ t .Run (tts [i ][0 ], func (t * testing.T ) {
295
+ assert .True (t , strhlp .IsSimilar (tts [i ][0 ])(tts [i ][1 ]),
296
+ "first should be similar to second" )
297
+ assert .True (t , strhlp .IsSimilar (tts [i ][1 ])(tts [i ][0 ]),
298
+ "second should be similar to first" )
299
+ })
300
+ }
301
+ }
You can’t perform that action at this time.
0 commit comments