2018-11-14 22:11:18 +00:00
|
|
|
(ns pronouns.util-test
|
|
|
|
(:require [pronouns.util :as util]
|
2018-11-15 05:47:31 +00:00
|
|
|
[clojure.test :refer [deftest testing is are]]))
|
2018-11-14 22:11:18 +00:00
|
|
|
|
2018-11-15 05:47:31 +00:00
|
|
|
(def test-table [["ze" "hir" "hir" "hirs" "hirself"]
|
2018-11-14 22:11:18 +00:00
|
|
|
["ze" "zir" "zir" "zirs" "zirself"]
|
|
|
|
["she" "her" "her" "hers" "herself"]
|
|
|
|
["he" "him" "his" "his" "himself"]
|
|
|
|
["they" "them" "their" "theirs" "themselves"]
|
|
|
|
["they" "them" "their" "theirs" "themself"]])
|
|
|
|
|
|
|
|
(deftest table-filters
|
|
|
|
(testing "table-front-filter"
|
2018-11-15 05:47:31 +00:00
|
|
|
(are [arg return] (= (util/table-front-filter arg test-table) return)
|
2018-11-14 22:11:18 +00:00
|
|
|
["she"] [["she" "her" "her" "hers" "herself"]]
|
|
|
|
["ze"] [["ze" "hir" "hir" "hirs" "hirself"]
|
|
|
|
["ze" "zir" "zir" "zirs" "zirself"]]
|
|
|
|
["ze" "zir"] [["ze" "zir" "zir" "zirs" "zirself"]]))
|
|
|
|
|
|
|
|
(testing "table-end-filter"
|
2018-11-15 05:47:31 +00:00
|
|
|
(are [arg return] (= (util/table-end-filter arg test-table) return)
|
2018-11-14 22:11:18 +00:00
|
|
|
["themself"] [["they" "them" "their" "theirs" "themself"]]
|
2018-11-15 05:47:31 +00:00
|
|
|
["themselves"] [["they" "them" "their" "theirs" "themselves"]])))
|
2018-11-14 22:11:18 +00:00
|
|
|
|
|
|
|
(deftest table-lookup
|
2018-11-15 05:47:31 +00:00
|
|
|
(are [arg return] (= (util/table-lookup arg test-table) return)
|
2018-11-14 22:11:18 +00:00
|
|
|
["she"] ["she" "her" "her" "hers" "herself"]
|
|
|
|
["ze"] ["ze" "hir" "hir" "hirs" "hirself"]
|
|
|
|
["ze" "zir"] ["ze" "zir" "zir" "zirs" "zirself"]
|
|
|
|
["they"] ["they" "them" "their" "theirs" "themselves"]
|
|
|
|
["they" "..." "themself"] ["they" "them" "their" "theirs" "themself"]))
|
|
|
|
|