23 lines
921 B
Elm
23 lines
921 B
Elm
module StringComparisonTest exposing (..)
|
|
|
|
import Expect exposing (Expectation)
|
|
import StringComparison exposing (isSimilarityLevelGreaterThan)
|
|
import Test exposing (Test, describe, test)
|
|
|
|
|
|
suite : Test
|
|
suite =
|
|
describe "isSimilarityLevelGreaterThan"
|
|
[ test "returns true when comparing string with more than level common chars" <|
|
|
\_ ->
|
|
isSimilarityLevelGreaterThan "abcdeijk" "abcdefgh" 5
|
|
|> Expect.equal True
|
|
, test "detects similarity even if the first string is shorter than the second" <|
|
|
\_ ->
|
|
isSimilarityLevelGreaterThan "zbcde" "abcdefgh" 4
|
|
|> Expect.equal True
|
|
, test "detects similarity even if the first string is longer than the second" <|
|
|
\_ ->
|
|
isSimilarityLevelGreaterThan "zBCDExkHamsld" "aBCDEfgH" 5
|
|
|> Expect.equal True
|
|
]
|