Skip to content

Commit

Permalink
fix the tests random failures
Browse files Browse the repository at this point in the history
by giving to the fuzzy distance calculation the input in stable order :-/
  • Loading branch information
marco-m-pix4d committed Dec 11, 2020
1 parent cca04b7 commit 6b2af7d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,13 @@ func matchFuzzy(create, destroy *strset.Set) (map[string]string, map[string]stri
}
reverse := map[string]candidate{}

for _, d := range destroy.List() {
for _, c := range create.List() {
destroyL := destroy.List()
sort.Strings(destroyL)
createL := create.List()
sort.Strings(createL)

for _, d := range destroyL {
for _, c := range createL {
// Here we could also use a custom NGramSizes via
// stringosim.QGramSimilarityOptions
dist := stringosim.QGram([]rune(d), []rune(c))
Expand Down

0 comments on commit 6b2af7d

Please sign in to comment.