Skip to content

Commit

Permalink
* add invoke
Browse files Browse the repository at this point in the history
* initial loop
* todos
  • Loading branch information
swannodette committed Nov 1, 2024
1 parent 3bf3b4e commit 8822838
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
; )
Expand Down

0 comments on commit 8822838

Please sign in to comment.