Skip to content

Commit 6b2af7d

Browse files
committed
fix the tests random failures
by giving to the fuzzy distance calculation the input in stable order :-/
1 parent cca04b7 commit 6b2af7d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,13 @@ func matchFuzzy(create, destroy *strset.Set) (map[string]string, map[string]stri
233233
}
234234
reverse := map[string]candidate{}
235235

236-
for _, d := range destroy.List() {
237-
for _, c := range create.List() {
236+
destroyL := destroy.List()
237+
sort.Strings(destroyL)
238+
createL := create.List()
239+
sort.Strings(createL)
240+
241+
for _, d := range destroyL {
242+
for _, c := range createL {
238243
// Here we could also use a custom NGramSizes via
239244
// stringosim.QGramSimilarityOptions
240245
dist := stringosim.QGram([]rune(d), []rune(c))

0 commit comments

Comments
 (0)