Skip to content

Commit

Permalink
* test-js-var
Browse files Browse the repository at this point in the history
* test-with-meta
* not working the-var case
  • Loading branch information
swannodette committed Nov 17, 2024
1 parent 70b16c7 commit 4cb5d04
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@
(is (= :js-object (:op node)))
(is (s/valid? ::a/node node))))

;; js-var
(deftest test-js-var
(let [node (analyze ns-env 'js/String)]
(is (= :js-var (:op node)))
(is (s/valid? ::a/node node))))

(deftest test-let
(let [node (analyze ns-env '(let []))]
Expand Down Expand Up @@ -211,7 +214,9 @@
(is (= :set! (:op node)))
(is (s/valid? ::a/node node))))

;; the-var
#_(deftest test-the-var
(let [node (no-warn (analyze ns-env '(var x)))]
(is (= :the-var (:op node)))))

(deftest test-throw
(let [node (no-warn (analyze ns-env '(throw (js/Error. "foo"))))]
Expand All @@ -230,7 +235,10 @@
(is (= :vector (:op node)))
(is (s/valid? ::a/node node))))

;; with-meta
(deftest test-with-meta
(let [node (analyze ns-env ^{:meta 2} {:foo 1})]
(is (= :with-meta (:op node)))
(is (s/valid? ::a/node node))))

(comment

Expand Down

0 comments on commit 4cb5d04

Please sign in to comment.