From 4cb5d043f6479c5881fbe24e5cb2194ff8a6d14b Mon Sep 17 00:00:00 2001 From: davidnolen Date: Sun, 17 Nov 2024 14:59:28 -0500 Subject: [PATCH] * test-js-var * test-with-meta * not working the-var case --- src/test/clojure/cljs/analyzer/spec_tests.clj | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/test/clojure/cljs/analyzer/spec_tests.clj b/src/test/clojure/cljs/analyzer/spec_tests.clj index 844c2e0d4..dbf6c5417 100644 --- a/src/test/clojure/cljs/analyzer/spec_tests.clj +++ b/src/test/clojure/cljs/analyzer/spec_tests.clj @@ -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 []))] @@ -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"))))] @@ -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