From 8822838eb9b6da87ebda50889ced286c2b59ab6e Mon Sep 17 00:00:00 2001 From: davidnolen Date: Fri, 1 Nov 2024 07:09:52 -0400 Subject: [PATCH] * add invoke * initial loop * todos --- src/test/clojure/cljs/analyzer/spec_tests.clj | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/test/clojure/cljs/analyzer/spec_tests.clj b/src/test/clojure/cljs/analyzer/spec_tests.clj index 61459a46b..faca7b06a 100644 --- a/src/test/clojure/cljs/analyzer/spec_tests.clj +++ b/src/test/clojure/cljs/analyzer/spec_tests.clj @@ -112,6 +112,31 @@ (is (= :host-field (:op node))) (is (s/valid? ::a/node node)))) +(deftest test-invoke + (let [node (no-warn (analyze ns-env '(count "foo")))] + (is (= :invoke (:op node))) + (is (s/valid? ::a/node node)))) + +(deftest test-loop + (let [node (analyze ns-env '(loop []))] + (is (= :loop (:op node))) + (is (s/valid? ::a/node node))) + (let [node (analyze ns-env '(loop [x 1] x))] + (is (s/valid? ::a/node node))) + #_(let [node (analyze ns-env '(loop [x 1] (recur (inc x))))] + (is (s/valid? ::a/node node))) + #_(let [node (no-warn + (analyze ns-env + '(loop [x 100] + (if (pos? x) + (recur (dec x)) + x))))] + (is (s/valid? ::a/node node)))) + +;; leftfn + +;; local + ; TODO: #js ;(deftest test-js-object ; )