5 (def trie-put #'frak/trie-put)
6 (def build-trie #'frak/build-trie)
9 (is (= (build-trie ["a" "b"])
19 (is (= (build-trie ["aaa" "ab"])
20 (build-trie ["ab" "aaa"])
35 (let [strs1 ["foo" "bar" "baz"]
36 strs2 ["baz" "bar" "foo"]
37 match1 (partial re-matches (pattern strs1))
38 match2 (partial re-matches (pattern strs2))]
39 (is (every? match1 strs1))
41 (is (every? match2 strs1))
43 (is (every? match1 strs2))
45 (is (every? match2 strs2))
47 (is (not (or (match1 "f")
52 (is (= (string-pattern ["foo" "foot"] nil)
53 (string-pattern ["foo" "" "foot"] nil)))
57 (string-pattern ["bat" "bar" "baz"] nil))))
59 (is (= "b(?:i[pt]|at)"
60 (string-pattern ["bat" "bip" "bit"] nil)))
63 (string-pattern ["foo" "foo?"])))
65 (are [words] (every? #(re-matches (pattern words) %) words)
66 ["achy" "achylia" "achylous" "achymia" "achymous"]
67 ["aching" "achingly"]))