Skip to content

Commit

Permalink
fixed tests for cljs
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-mor committed Sep 16, 2024
1 parent 7a2fe14 commit eaadcb2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/com/rpl/specter/core_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eaadcb2

Please sign in to comment.