-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forms which macroexpand into deftest aren't recognised by cider-test-run-test #1776
Labels
Comments
Seems like the line |
ncalexan
added a commit
to ncalexan/cider
that referenced
this issue
Jan 3, 2017
…efining-names`. This fix is strictly simpler than that suggested in clojure-emacs#1776 (comment). It has the advantage of being much more robust. I partially implemented the suggested fix, and witnessed the following two issues. First, full "macroexpand" does not leave a recognizable `deftest` form; it generally leaves a `(def test-... (fn [] ...))` sexp. That implies that a recursive macroexpansion would be required, with each step of the recursion checking for a recognized form. Second, even recognizing such a form is tricky, because the expansion may refer to deftest in an aliased namespace (e.g., `t/deftest` or `clojure.test/deftest` rather than bare `deftest`). One could then try to identify possible namespaces using the current environment, but this is getting complicated. Therefore, I think it better to have the user configure their environment to help them solve this problem. (And, of course, future work can implement the full macroexpansion approach.)
4 tasks
ncalexan
added a commit
to ncalexan/cider
that referenced
this issue
Jan 4, 2017
…efining-forms`. This fix is strictly simpler than that suggested in clojure-emacs#1776 (comment). It has the advantage of being much more robust. I partially implemented the suggested fix, and witnessed the following two issues. First, full "macroexpand" does not leave a recognizable `deftest` form; it generally leaves a `(def test-... (fn [] ...))` sexp. That implies that a recursive macroexpansion would be required, with each step of the recursion checking for a recognized form. Second, even recognizing such a form is tricky, because the expansion may refer to deftest in an aliased namespace (e.g., `t/deftest` or `clojure.test/deftest` rather than bare `deftest`). One could then try to identify possible namespaces using the current environment, but this is getting complicated. Therefore, I think it better to have the user configure their environment to help them solve this problem. (And, of course, future work can implement the full macroexpansion approach.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
cider-test-run-test
should run the test at point, even if it is not directly declared in the Emacs buffer withdeftest
.You might use a convenience macro which macroexpands into a
deftest
form as a means of following Stuart Sierra's advice to avoidclojure.test
's fixtures mechanism, for example.Actual behavior
"No test at point"
Steps to reproduce the problem
Invoke
cider-test-run-test
with the point infancytest
and you'll get "No test at point" in the minibuffer.Environment & Version information
CIDER version information
Lein/Boot version
boot 2.5.5
Emacs version
24.4.1
Operating system
OS X 10.11
The text was updated successfully, but these errors were encountered: