Add min-version tests

This commit is contained in:
Michiel Borkent 2021-04-28 11:26:49 +02:00
parent 514fc84cde
commit f2ec857c66

View file

@ -48,6 +48,13 @@
(is (:babashka/version v)) (is (:babashka/version v))
(is (:feature/xml v)))) (is (:feature/xml v))))
(deftest version-test
(is (= [1 0 0] (main/parse-version "1.0.0-SNAPSHOT")))
(is (main/satisfies-min-version? "0.1.0"))
(is (main/satisfies-min-version? "0.1.0-SNAPSHOT"))
(is (not (main/satisfies-min-version? "300.0.0")))
(is (not (main/satisfies-min-version? "300.0.0-SNAPSHOT"))))
(deftest print-error-test (deftest print-error-test
(is (thrown-with-msg? Exception #"java.lang.NullPointerException" (is (thrown-with-msg? Exception #"java.lang.NullPointerException"
(bb nil "(subs nil 0 0)")))) (bb nil "(subs nil 0 0)"))))