From 4d7210e29b9f8ce3ab3bdfa7231e76dc94fe3acf Mon Sep 17 00:00:00 2001 From: davidnolen Date: Mon, 18 Nov 2024 10:51:29 -0800 Subject: [PATCH] * case-node, case-test, case-then --- src/test/clojure/cljs/analyzer/spec_tests.clj | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/test/clojure/cljs/analyzer/spec_tests.clj b/src/test/clojure/cljs/analyzer/spec_tests.clj index e365e2414..bafaf9245 100644 --- a/src/test/clojure/cljs/analyzer/spec_tests.clj +++ b/src/test/clojure/cljs/analyzer/spec_tests.clj @@ -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)))