Skip to content

Commit

Permalink
* add basic do
Browse files Browse the repository at this point in the history
* failing let, due to missing :form
  • Loading branch information
swannodette committed Oct 24, 2024
1 parent 2009627 commit 9f988d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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])))

)
2 changes: 1 addition & 1 deletion src/test/clojure/cljs/analyzer/specs.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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?)

Expand Down

0 comments on commit 9f988d8

Please sign in to comment.