From eaadcb2762ca85adf205e61f12045836b1283fc0 Mon Sep 17 00:00:00 2001 From: tommy-mor Date: Mon, 16 Sep 2024 10:28:40 -0400 Subject: [PATCH] fixed tests for cljs --- test/com/rpl/specter/core_test.cljc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/com/rpl/specter/core_test.cljc b/test/com/rpl/specter/core_test.cljc index e8b416c..8323b4f 100644 --- a/test/com/rpl/specter/core_test.cljc +++ b/test/com/rpl/specter/core_test.cljc @@ -1440,10 +1440,14 @@ (is (= "abq" (setval s/LAST "q" "abc"))) ) +(defn whitespace? [char] + (re-matches #"\s" (str char))) + (deftest string-transform-test (is (= "123" (transform s/ALL identity "123"))) - (is (= "123" (setval [s/ALL #(Character/isWhitespace %)] s/NONE "1 2 3"))) - (is (= "123" (transform [(s/filterer #(Character/isWhitespace %))] s/NONE "1 2 3")))) + (is (= "123" (transform [s/ALL whitespace?] s/NONE "1 2 3"))) + #?(:clj (is (= "123" (setval [s/ALL #(Character/isWhitespace %)] s/NONE "1 2 3")))) + #?(:clj (is (= "123" (transform [(s/filterer #(Character/isWhitespace %))] s/NONE "1 2 3"))))) (deftest regex-navigation-test ;; also test regexes as implicit navs