From 55c8b127ad3ea798941d9ab414e6c6e6b741cc2c Mon Sep 17 00:00:00 2001 From: davidnolen Date: Fri, 25 Oct 2024 17:20:13 -0400 Subject: [PATCH] * const tests --- src/test/clojure/cljs/analyzer/spec_tests.clj | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/clojure/cljs/analyzer/spec_tests.clj b/src/test/clojure/cljs/analyzer/spec_tests.clj index 95bcd6d53..59346f1d6 100644 --- a/src/test/clojure/cljs/analyzer/spec_tests.clj +++ b/src/test/clojure/cljs/analyzer/spec_tests.clj @@ -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)))))