From 9f988d8eadbfb632651318e005e9111bd6a1307a Mon Sep 17 00:00:00 2001 From: davidnolen Date: Thu, 24 Oct 2024 07:40:42 -0400 Subject: [PATCH] * add basic do * failing let, due to missing :form --- src/test/clojure/cljs/analyzer/spec_tests.clj | 14 ++++++++++++++ src/test/clojure/cljs/analyzer/specs.cljc | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/test/clojure/cljs/analyzer/spec_tests.clj b/src/test/clojure/cljs/analyzer/spec_tests.clj index ff8888ec5..b514d6a7d 100644 --- a/src/test/clojure/cljs/analyzer/spec_tests.clj +++ b/src/test/clojure/cljs/analyzer/spec_tests.clj @@ -16,8 +16,22 @@ (is (s/valid? ::a/node (analyze ns-env '(if true true)))) (is (s/valid? ::a/node (analyze ns-env '(if true true false))))) +(deftest test-do + (is (s/valid? ::a/node (analyze ns-env '(do)))) + (is (s/valid? ::a/node (analyze ns-env '(do 1)))) + (is (s/valid? ::a/node (analyze ns-env '(do 1 2 3))))) + +(deftest test-let + (is (s/valid? ::a/node (analyze ns-env '(let [])))) + ;(is (s/valid? ::a/node (analyze ns-env '(let [x 1])))) + ;(is (s/valid? ::a/node (analyze ns-env '(let [x 1] x)))) + ) + (comment (test/run-tests) + ;; binding is missing :form + (s/explain ::a/node (analyze ns-env '(let [x 1]))) + ) diff --git a/src/test/clojure/cljs/analyzer/specs.cljc b/src/test/clojure/cljs/analyzer/specs.cljc index 64b2e8835..a99818c3f 100644 --- a/src/test/clojure/cljs/analyzer/specs.cljc +++ b/src/test/clojure/cljs/analyzer/specs.cljc @@ -151,7 +151,7 @@ (s/keys :req-un [::t ::body]))) -(s/def ::statements ::node) +(s/def ::statements (s/* ::node)) (s/def ::ret ::node) (s/def ::body? boolean?)