You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
c4k-common/src/test/cljc/dda/c4k_common/common_test.cljc

28 lines
916 B
Clojure

(ns dda.c4k-common.common-test
(:require
#?(:clj [clojure.test :refer [deftest is are testing run-tests]]
:cljs [cljs.test :refer-macros [deftest is are testing run-tests]])
[clojure.spec.test.alpha :as st]
[dda.c4k-common.common :as cut]))
(st/instrument `cut/concat-vec)
(deftest should-concat-vec
(is (= ["a1" "a2" "b1"]
(cut/concat-vec ["a1" "a2"] ["b1"])))
(is (= ["a1" "a2" "b1"]
(cut/concat-vec '("a1" "a2") ["b1"])))
(is (= ["a1" "a2" "b1"]
(cut/concat-vec '("a1" "a2") '("b1")))))
#?(:clj
(deftest should-refuse-illegal-inputs
(is (thrown? Exception
(cut/concat-vec ["a1" "a2"] "b1")))
(is (thrown? Exception
(cut/concat-vec ["a1" "a2"] nil)))
(is (thrown? Exception
(cut/concat-vec ["a1" "a2"] 2)))
(is (thrown? Exception
(cut/concat-vec {"a1" "a2"} [])))))