Skip to content

Commit

Permalink
adds couple test cases
Browse files Browse the repository at this point in the history
Suggested-by: Michiel Borkent <[email protected]>
  • Loading branch information
agzam committed Nov 12, 2023
1 parent ae2ab46 commit 84bf9ce
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,21 @@
#_(is (any? (run-dep-subcommand "search" "org.clojure/tools.cli")))
(is (any? (run-dep-subcommand "search" "babashka nrepl")))
(is (thrown-with-msg? Exception #"Unable to find"
(run-dep-subcommand "search" "%22searchTermThatIsn'tFound"))))
(run-dep-subcommand "search" "%22searchTermThatIsn'tFound")))
(is (some #(str/starts-with? % "Usage: neil dep search")
(run-dep-subcommand "search" "42"))
"passing non-string shows help")
(is (some #(str/starts-with? % "Usage: neil dep search")
(run-dep-subcommand "search" " "))
"passing blank string shows help")
(is (some
(partial
re-matches
(re-pattern
(str ":lib org.clojure/clojurescript "
":version \"\\d+(\\.\\d+)+\" "
":description \"org.clojure/clojurescript on Maven\"")))
(run-dep-subcommand "search" "\"org.clojure/clojurescript\""))))

(defn run-license [filename subcommand & [args]]
(let [args (or args "")]
Expand Down

0 comments on commit 84bf9ce

Please sign in to comment.