Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Nov 2, 2023
1 parent 8f70bfe commit 7b9e0c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src-squint/babashka/cli/test_macros.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,8 @@

(defmacro is [& args]
`(do ~@args))

(defmacro thrown-with-msg? [ex-type regex body]
`(try ~body
(catch ~ex-type ~'e
(is (re-matches ~regex (.-message ~'e))))))
3 changes: 2 additions & 1 deletion src/babashka/cli.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
(nth arg 1 nil)))

#?(:squint (do (def keyword identity)
(def symbol identity)))
(def symbol identity)
(def name identity)))

(defn parse-keyword
"Parse keyword from `s`. Ignores leading `:`."
Expand Down
6 changes: 4 additions & 2 deletions test/babashka/cli_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
#?@(:squint [["assert" :as assert]]
:clj [[clojure.edn :as edn]]
:cljs [[cljs.reader :as edn]]))
#?(:squint (:require-macros [babashka.cli.test-macros :refer [deftest is testing]])))
#?(:squint (:require-macros [babashka.cli.test-macros :refer [deftest is testing
thrown-with-msg?]])))

#?(:squint (do (def keyword identity)
(def symbol identity)))
(def symbol identity)
(def name identity)))

(defn normalize-filename [s]
(str/replace s "\\" "/"))
Expand Down

0 comments on commit 7b9e0c7

Please sign in to comment.