Skip to content

Commit

Permalink
* fn-method
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Nov 18, 2024
1 parent 4d7210e commit cf2d7fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@
(is (s/valid? ::a/node (analyze ns-env '(fn [x]))))
(is (s/valid? ::a/node (analyze ns-env '(fn [x] 1)))))

;; fn-method
(deftest test-fn-method
(let [node (analyze ns-env '(fn ([]) ([x] x)))
methods (:methods node)
fn0 (first methods)
fn1 (second methods)]
(is (= :fn-method (:op fn0)))
(is (s/valid? ::a/node fn0))
(is (= :fn-method (:op fn1)))
(is (s/valid? ::a/node fn1))))

(deftest test-host-call
(let [node (analyze ns-env '(.substring "foo" 0 1))]
Expand Down

0 comments on commit cf2d7fc

Please sign in to comment.