2016-09-24 08:28:13 +00:00
|
|
|
(ns pronouns.pages-test
|
|
|
|
(:require [pronouns.pages :as pages]
|
2018-11-14 20:49:17 +00:00
|
|
|
[clojure.test :refer [deftest testing is are]]))
|
2016-09-24 08:28:13 +00:00
|
|
|
|
2018-11-14 20:49:17 +00:00
|
|
|
(deftest prose-comma-list
|
2018-11-16 06:23:30 +00:00
|
|
|
(testing "`prose-comma-list` turns a list of strings into a prose list"
|
2018-11-16 06:16:19 +00:00
|
|
|
(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"]
|
2018-11-16 06:23:30 +00:00
|
|
|
["they" "them" "their" "theirs" "themselves"])
|
2018-11-16 06:16:19 +00:00
|
|
|
["she/her" "foo/bar"] '(["she" "her" "her" "hers" "herself"])
|
|
|
|
["foo/bar"] '()
|
|
|
|
["a/b/c/d/e"] '(("a" "b" "c" "d" "e"))))
|