Skip to content

Commit

Permalink
* case-node, case-test, case-then
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Nov 18, 2024
1 parent 82efd24 commit 4d7210e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@
(let [let-node (no-warn (analyze ns-env '(case x 1 :foo 2 :bar)))
node (-> let-node :body :ret)]
(is (= :case (:op node)))
(is (s/valid? ::a/node node))))

;; case-test
;; case-node
;; case-then
(is (s/valid? ::a/node node))
(let [nodes (-> node :nodes)
case-node (first nodes)]
(is (= :case-node (:op case-node)))
(is (s/valid? ::a/node case-node))
(let [case-tests (:tests case-node)
case-test (first case-tests)
case-then (:then case-node)]
(is (= :case-test (:op case-test)))
(is (s/valid? ::a/node case-test))
(is (= :case-then (:op case-then)))
(is (s/valid? ::a/node case-then))))))

(deftest test-const
(is (s/valid? ::a/node (analyze ns-env 1)))
Expand Down

0 comments on commit 4d7210e

Please sign in to comment.