Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv committed Oct 5, 2021
1 parent 9c1bc95 commit 1dfeef8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/clj/cider/nrepl/middleware/macroexpand_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@
:expanded-all "(loop* [] (if (loop* [] (if 1 (do (recur)))) (do (recur))))"})

(deftest expander-option-test

;; https://github.com/clojure-emacs/cider-nrepl/issues/721
(let [i (atom 0)]
(doseq [code ["(definterface IFoo%s)" "(definterface IFoo%s (^int tailoff []))"]
expander ["macroexpand-1" "macroexpand-all"]]
(testing (pr-str ["definterface" code expander])
(let [{:keys [expansion status err]
:as response} (session/message {:op "macroexpand"
:expander expander
:code (format code (swap! i inc))
:display-namespaces "none"})]
(testing (pr-str response)
(or (is (string? expansion))
(some-> err println))
(is (= #{"done"} status)))))))

(testing "macroexpand-1 expander works"
(let [{:keys [expansion status]} (session/message {:op "macroexpand"
:expander "macroexpand-1"
Expand Down

0 comments on commit 1dfeef8

Please sign in to comment.