From 5aed3b254e6989e610d970385c4838f88c626d64 Mon Sep 17 00:00:00 2001 From: Michael Fogleman Date: Thu, 19 Oct 2017 10:52:23 -0400 Subject: [PATCH] Add regex-navigation-test. --- test/com/rpl/specter/core_test.cljc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/com/rpl/specter/core_test.cljc b/test/com/rpl/specter/core_test.cljc index 58c015c..6353d61 100644 --- a/test/com/rpl/specter/core_test.cljc +++ b/test/com/rpl/specter/core_test.cljc @@ -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))))