Skip to content

Commit

Permalink
feat: add Jaccard distance test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao-Ma5566 committed Dec 12, 2023
1 parent ea35982 commit 2f84952
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/findincsv/findincsv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,3 +482,12 @@ func cleanupTempFile(filePath string) error {
}
return nil
}

func TestJaccardSimilarityShouldReturnWaitedNumber(t *testing.T) {
entry := "1 Boulevard Albert Einstain"
csv := "1 Boulevard Albert Einstein"

waited := JaccardSimilarity(entry, csv)
expect := 0.8518518518518519
assert.Equal(t, expect, waited)
}

0 comments on commit 2f84952

Please sign in to comment.