From 84bf9cee8cabc27e008e7584ea2bbcf62f03b412 Mon Sep 17 00:00:00 2001 From: Ag Ibragimov Date: Sun, 12 Nov 2023 14:02:57 -0600 Subject: [PATCH] adds couple test cases Suggested-by: Michiel Borkent --- tests.clj | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests.clj b/tests.clj index b6f6b31c..f83be447 100644 --- a/tests.clj +++ b/tests.clj @@ -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 "")]