Skip to content

Commit

Permalink
test case
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Dec 18, 2023
1 parent baeaab2 commit 2effc24
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/babashka/cli_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,16 @@
(cli/dispatch table ["foo" "bar" "--baz" "baz" "--quux" "xyzzy"]))))

(d/deflet
(def tree {"foo" {:fn identity
"bar" {"baz" {:fn identity}}}})
(def tree {"foo" {"bar" {:fn identity
"baz" {:fn identity}}
:spec {:bar {:coerce :keyword}}
:fn identity}})
;; TODO: change :dispatch to :cmds?
(is (submap?
{:dispatch ["foo"]}
(cli/dispatch-tree tree ["foo"])))))
{:dispatch ["foo" "bar"]
:opts {:bar :bar}}
(cli/dispatch-tree tree ["foo" "--bar" "bar" "bar"])))
))

(deftest no-keyword-opts-test (is (= {:query [:a :b :c]}
(cli/parse-opts
Expand Down

0 comments on commit 2effc24

Please sign in to comment.