Skip to content

Commit

Permalink
* add binding, note about list, add set, typo
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Nov 17, 2024
1 parent 66487bb commit 6226322
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
[clojure.test :as test :refer [deftest is]]
[clojure.spec.alpha :as s]))

;; binding
(deftest test-binding
(let [node (analyze ns-env '(let [x 1] x))
binding (-> node :bindings first)]
(is (= :binding (:op binding)))
(is (s/valid? ::a/node binding))))

(deftest test-case
(let [node (no-warn (analyze ns-env '(case x 1 :foo 2 :bar)))]
Expand Down Expand Up @@ -126,7 +130,7 @@

;; letfn

;; list
;; list, no longer needed, subsumed by :quote

;; local

Expand Down Expand Up @@ -174,7 +178,10 @@
(let [node (no-warn (analyze ns-env '(fn [x] (recur (inc x)))))]
(is (s/valid? ::a/node node))))

;; set
(deftest test-set
(let [node (no-warn (analyze ns-env #{1 2 3}))]
(is (= :set (:op node)))
(is (s/valid? ::a/node node))))

;; set!

Expand All @@ -189,7 +196,7 @@

;; var

(deftest test-map
(deftest test-vector
(let [node (no-warn (analyze ns-env '[1 2]))]
(is (= :vector (:op node)))
(is (s/valid? ::a/node node))))
Expand Down

0 comments on commit 6226322

Please sign in to comment.