diff --git a/test/modifiers.jl b/test/modifiers.jl index 40f2c1c..18ef928 100644 --- a/test/modifiers.jl +++ b/test/modifiers.jl @@ -122,3 +122,26 @@ fuzz.WRatio("mariners", "mariner are playing tomorrow mariner are playing tomorr fuzz.WRatio("mariners", "mariner are playing tomorrow mariner are playing tomorrow mariner are playing tomorrow mariner are playing tomorrow") fuzz.WRatio("mariners", "mariner are playing tomorrow mariner are playing tomorrow mariner are playing tomorrow mariner are playing tomorrow") =# + + +using StringDistances, Test + +# check with weird utf8 strings +compare("aüa", "aua", TokenMax(RatcliffObershelp())) +compare("aüa", "aua", TokenMax(QGram(2))) +compare("aüa", "aua", DamerauLevenshtein()) +compare("aüa", "aua", Hamming()) +compare("aüa", "aua", Jaro()) +compare("aüa", "aua", Levenshtein()) + + +s1 = "aü☃" +s2 = "aüaüafs" +dist = QGram(4) +@test evaluate(dist, s1, s2) == 4 + +# check Substrings work +s1 = SubString(s1, 1, 4) +s2 = SubString(s2, 1, 4) +dist = QGram(2) +@test evaluate(dist, s1, s2) == 2 diff --git a/test/runtests.jl b/test/runtests.jl index 47cc30c..05e72a4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,6 @@ using StringDistances -tests = ["distances.jl", "modifiers.jl", "utf8.jl"] +tests = ["distances.jl", "modifiers.jl"] println("Running tests:") diff --git a/test/utf8.jl b/test/utf8.jl deleted file mode 100644 index 36e47ec..0000000 --- a/test/utf8.jl +++ /dev/null @@ -1,21 +0,0 @@ -using StringDistances, Test - -# check with weird utf8 strings -compare("aüa", "aua", TokenMax(RatcliffObershelp())) -compare("aüa", "aua", TokenMax(QGram(2))) -compare("aüa", "aua", DamerauLevenshtein()) -compare("aüa", "aua", Hamming()) -compare("aüa", "aua", Jaro()) -compare("aüa", "aua", Levenshtein()) - - -s1 = "aü☃" -s2 = "aüaüafs" -dist = QGram(4) -@test evaluate(dist, s1, s2) == 4 - -# check Substrings work -s1 = SubString(s1, 1, 4) -s2 = SubString(s2, 1, 4) -dist = QGram(2) -@test evaluate(dist, s1, s2) == 2