diff options
author | Morgan Astra <m@morganastra.me> | 2018-11-15 22:16:19 -0800 |
---|---|---|
committer | Morgan Astra <m@morganastra.me> | 2018-11-15 22:16:19 -0800 |
commit | c63934ec56e80c5c5058e3d6d97af74a669ceda8 (patch) | |
tree | 037ba91a98534dc3ae0f68ccd4aca31e673d109f /test/pronouns/pages_test.clj | |
parent | ef32711b172d10ee7c63b72ff97a2cbb9fc03c3a (diff) |
Refactor pages for testability and add tests
Diffstat (limited to 'test/pronouns/pages_test.clj')
-rw-r--r-- | test/pronouns/pages_test.clj | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/test/pronouns/pages_test.clj b/test/pronouns/pages_test.clj index e32a2ee..b4b00fb 100644 --- a/test/pronouns/pages_test.clj +++ b/test/pronouns/pages_test.clj @@ -4,9 +4,20 @@ (deftest prose-comma-list (testing "prose-comma-list turns a list of strings into a prose list" - (are [call result] (= call result) - (pages/prose-comma-list ["foo"]) "foo" - (pages/prose-comma-list ["foo" "bar"]) "foo and bar" - (pages/prose-comma-list ["foo" "bar" "baz"]) "foo, bar, and baz" - (pages/prose-comma-list ["foo" "bar" "baz" "bobble"]) "foo, bar, baz, and bobble" - (pages/prose-comma-list []) ""))) + (are [v s] (= (pages/prose-comma-list v) s) + ["foo" "bar" "baz" "bobble"] "foo, bar, baz, and bobble" + ["foo" "bar" "baz"] "foo, bar, and baz" + ["foo" "bar"] "foo and bar" + ["foo"] "foo" + [] ""))) + +(deftest lookup-pronouns + (are [pronoun-strs pronouns] + (= (pages/lookup-pronouns pronoun-strs) + pronouns) + ["she/her"] '(["she" "her" "her" "hers" "herself"]) + ["she" "they"] '(["she" "her" "her" "hers" "herself"] + ["they" "them" "their" "theirs" "themselves"]) + ["she/her" "foo/bar"] '(["she" "her" "her" "hers" "herself"]) + ["foo/bar"] '() + ["a/b/c/d/e"] '(("a" "b" "c" "d" "e")))) |