From 68e120f6bf63164a5a1afbb5f1be8b38209b2685 Mon Sep 17 00:00:00 2001 From: davidnolen Date: Fri, 25 Oct 2024 11:06:51 -0400 Subject: [PATCH] * add tests for new --- src/test/clojure/cljs/analyzer/spec_tests.clj | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/clojure/cljs/analyzer/spec_tests.clj b/src/test/clojure/cljs/analyzer/spec_tests.clj index 2653299d3..ef5ba35ec 100644 --- a/src/test/clojure/cljs/analyzer/spec_tests.clj +++ b/src/test/clojure/cljs/analyzer/spec_tests.clj @@ -7,7 +7,8 @@ ;; You must not remove this notice, or any other, from this software. (ns cljs.analyzer.spec-tests - (:require [cljs.analyzer-tests :refer [analyze ns-env]] + (:require [cljs.analyzer.api :as ana :refer [no-warn]] + [cljs.analyzer-tests :refer [analyze ns-env]] [cljs.analyzer.specs :as a] [clojure.test :as test :refer [deftest is]] [clojure.spec.alpha :as s])) @@ -26,6 +27,12 @@ (is (s/valid? ::a/node (analyze ns-env '(let [x 1])))) (is (s/valid? ::a/node (analyze ns-env '(let [x 1] x))))) +(deftest test-new + (is (s/valid? ::a/node (no-warn (analyze ns-env '(new String))))) + (is (s/valid? ::a/node (no-warn (analyze ns-env '(new js/String))))) + (is (s/valid? ::a/node (no-warn (analyze ns-env '(String.))))) + (is (s/valid? ::a/node (no-warn (analyze ns-env '(js/String.)))))) + (comment (test/run-tests)