Add regex-navigation-test.
This commit is contained in:
parent
d7ee2f7c6a
commit
5aed3b254e
1 changed files with 8 additions and 0 deletions
|
|
@ -1434,6 +1434,14 @@
|
|||
(is (= "abq" (setval s/LAST "q" "abc")))
|
||||
)
|
||||
|
||||
(deftest regex-navigation-test
|
||||
(is (= (select #"t" "test") ["t" "t"]))
|
||||
(is (= (select [:a #"t"] {:a "test"}) ["t" "t"]))
|
||||
(is (= (transform #"t" clojure.string/capitalize "test") "TesT"))
|
||||
(is (= (transform [:a #"t"] clojure.string/capitalize {:a "test"}) {:a "TesT"}))
|
||||
(is (= (setval #"t" "z" "test") "zesz"))
|
||||
(is (= (setval [:a #"t"] "z" {:a "test"}) {:a "zesz"})))
|
||||
|
||||
(deftest single-value-none-navigators-test
|
||||
(is (predand= vector? [1 2 3] (setval s/AFTER-ELEM 3 [1 2])))
|
||||
(is (predand= list? '(1 2 3) (setval s/AFTER-ELEM 3 '(1 2))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue