Add better-cond to CI tests
This commit is contained in:
parent
9dd4941230
commit
6d14ed61f1
4 changed files with 46 additions and 4 deletions
7
deps.edn
7
deps.edn
|
|
@ -92,10 +92,11 @@
|
|||
com.stuartsierra/component {:mvn/version "1.0.0"}
|
||||
org.clojars.askonomm/ruuter {:mvn/version "1.2.2"}
|
||||
org.clj-commons/digest {:mvn/version "1.4.100"}
|
||||
hato/hato {:mvn/version "0.8.2"}}
|
||||
hato/hato {:mvn/version "0.8.2"}
|
||||
better-cond/better-cond {:mvn/version "2.1.1"}
|
||||
org.clojure/core.specs.alpha {:mvn/version "0.2.62"}}
|
||||
:classpath-overrides {org.clojure/clojure nil
|
||||
org.clojure/spec.alpha nil
|
||||
org.clojure/core.specs.alpha nil}}
|
||||
org.clojure/spec.alpha nil}}
|
||||
:clj-nvd
|
||||
{:extra-deps {clj-nvd/clj-nvd {:git/url "https://github.com/miikka/clj-nvd.git"
|
||||
:sha "f2ec98699e057a379baf170cb49cf7ad76874a70"}}
|
||||
|
|
|
|||
|
|
@ -733,7 +733,7 @@ Use bb run --help to show this help output.
|
|||
(println "[babashka] WARNING: Use the babashka-compatible version of clojure.spec.alpha, available here: https://github.com/babashka/spec.alpha"))
|
||||
clojure.core.specs.alpha
|
||||
(binding [*out* *err*]
|
||||
(println "[babashka] WARNING: clojure.core.specs.alpha isremoved from the classpath, unless you explicitly add the dependency."))
|
||||
(println "[babashka] WARNING: clojure.core.specs.alpha is removed from the classpath, unless you explicitly add the dependency."))
|
||||
nil)))
|
||||
main (if (and jar (not main))
|
||||
(when-let [res (cp/getResource
|
||||
|
|
|
|||
|
|
@ -265,6 +265,7 @@
|
|||
|
||||
(test-namespaces 'hato.client-test)
|
||||
|
||||
(test-namespaces 'better-cond.core-test)
|
||||
;;;; final exit code
|
||||
|
||||
(let [{:keys [:test :fail :error] :as m} @status]
|
||||
|
|
|
|||
40
test-resources/lib_tests/better_cond/core_test.cljc
Normal file
40
test-resources/lib_tests/better_cond/core_test.cljc
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
(ns better-cond.core-test
|
||||
(:refer-clojure :exclude [cond if-let when-let if-some when-some])
|
||||
(:require [better-cond.core :refer [cond]]
|
||||
[clojure.test :refer [deftest are]]))
|
||||
|
||||
(deftest better-cond
|
||||
(are [x y] (= x y)
|
||||
2 (cond (even? 3) 5
|
||||
(odd? 3) 2)
|
||||
2 (cond (even? 3) 5
|
||||
:else 2)
|
||||
2 (cond
|
||||
:let [x 2]
|
||||
x)
|
||||
2 (cond
|
||||
:when-let [x 2]
|
||||
x)
|
||||
2 (cond
|
||||
:when-some [x 2]
|
||||
x)
|
||||
nil (cond
|
||||
:when-let [x false]
|
||||
2)
|
||||
2 (cond
|
||||
:when-let [x true]
|
||||
2)
|
||||
nil (cond
|
||||
:when-let [x nil]
|
||||
2)
|
||||
2 (cond
|
||||
:when-some [x false]
|
||||
2)
|
||||
2 (cond
|
||||
:when (even? 4)
|
||||
2)
|
||||
nil (cond
|
||||
:when (even? 3)
|
||||
2)))
|
||||
|
||||
|
||||
Loading…
Reference in a new issue