Skip to content

Commit

Permalink
* add tests for new
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Oct 25, 2024
1 parent 45bc823 commit 68e120f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand All @@ -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)
Expand Down

0 comments on commit 68e120f

Please sign in to comment.