Skip to content

Commit

Permalink
* add deftype
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Nov 1, 2024
1 parent 2cc8c5c commit d0ece88
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,15 @@
(is (s/valid? ::a/node (no-warn (analyze ns-env '(String.)))))
(is (s/valid? ::a/node (analyze ns-env '(js/String.)))))

(deftest test-deftype
(let [node (no-warn (analyze ns-env '(deftype A [])))]
(is (= :deftype (-> node :statements first :op)))
(is (s/valid? ::a/node node))))

(deftest test-defrecord
(let [node (no-warn (analyze ns-env '(defrecord A [])))
body (:body node)]
(is (= :defrecord (->> body :statements first :ret :op)))
(is (= :defrecord (-> body :statements first :ret :op)))
(is (s/valid? ::a/node node))))

; TODO: #js
Expand Down

0 comments on commit d0ece88

Please sign in to comment.