Skip to content

Commit

Permalink
* const tests
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Oct 25, 2024
1 parent 83dadc9 commit 55c8b12
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
[clojure.test :as test :refer [deftest is]]
[clojure.spec.alpha :as s]))

(deftest test-const
(is (s/valid? ::a/node (analyze ns-env 1)))
(is (s/valid? ::a/node (analyze ns-env 1.2)))
(is (s/valid? ::a/node (analyze ns-env true)))
(is (s/valid? ::a/node (analyze ns-env "foo")))
(is (s/valid? ::a/node (analyze ns-env [])))
(is (s/valid? ::a/node (analyze ns-env [1 2 3])))
(is (s/valid? ::a/node (analyze ns-env {})))
(is (s/valid? ::a/node (analyze ns-env {1 2 3 4})))
(is (s/valid? ::a/node (analyze ns-env #{})))
(is (s/valid? ::a/node (analyze ns-env #{1 2 3}))))

(deftest test-if
(is (s/valid? ::a/node (analyze ns-env '(if true true))))
(is (s/valid? ::a/node (analyze ns-env '(if true true false)))))
Expand Down

0 comments on commit 55c8b12

Please sign in to comment.