Skip to content
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

Keybindings in Test Report Mode not working. #885

Closed
verdammelt opened this issue Nov 21, 2014 · 6 comments · Fixed by #918
Closed

Keybindings in Test Report Mode not working. #885

verdammelt opened this issue Nov 21, 2014 · 6 comments · Fixed by #918
Labels

Comments

@verdammelt
Copy link

I first noticed this in 0.7.0 and have also seen it in 0.8.0 and just reconfirmed the problem in 0.8.1 (each run with matching nrepl version). Emacs version 24.4.50.1.

When a failing test causes the Test Report Mode window to open some keybindings are not working.

d, e & t all seem to have no effect.

It seems that no matter where point is when e is pressed the same message is shown No test error at point. Same with d except that the message is No test failure at point.

With t if point is not on a symbol it prompts for a symbol to jump to. When on a symbol it will jump to it but when point is on a useful symbol such as the test name then there is an error with message Symbol <test-name> not resolved.

@bbatsov
Copy link
Member

bbatsov commented Nov 21, 2014

Yep, this is definitely a bug. Will investigate!

@bbatsov
Copy link
Member

bbatsov commented Nov 30, 2014

A quick look at the issue shows that the problem's here https://github.com/clojure-emacs/cider/blob/master/cider-test.el#L158

The properties are all present, but aren't retrieved for some bizarre reason. Will investigate more when I can. Anyone is welcome to lend a hand in the meantime.

@verdammelt
Copy link
Author

Not sure what you mean by 'The properties are all present' because in a test report buffer when I evaluate (get-text-property (point) 'ns) with point on the namespace, the '1 failures' line, the 'Fail' on the failure, or the test name of the failure it always returns nil

Where should point be for this to work?

@bbatsov
Copy link
Member

bbatsov commented Nov 30, 2014

Place your cursor over a test name and type M-x describe-text-properties. You'll see that the properties are actually there, which is why I described the problem as bizarre.

@verdammelt
Copy link
Author

ah! I see what you mean now. sorry for the misunderstanding and thank you for explaining.

@llasram
Copy link
Contributor

llasram commented Dec 17, 2014

I'm seeing the same bug, and have a superficial diagnosis, but I can't figure out how the relevant code should be working to find what's missing.

The problem is that the properties on the text are named by strings (e.g. "actual") instead of Emacs Lisp symbols (e.g. 'actual). The Emacs describe-text-properties function enumerates the properties, and somehow ends up printing strings the same as symbols -- I assume as an unexpected side-effect due to noone ever expecting to find strings as property names. The get-text-property function uses eq to find the matching property-list member, and thus can never find the string version.

llasram pushed a commit to llasram/cider that referenced this issue Dec 18, 2014
Maps received via nREPL have string keys.  The Emacs Lisp text property
functions expect all property keys to be symbols.  Thus we must first intern any
non-symbol property keys prior to applying them as text properties.  Fixes clojure-emacs#885.
llasram pushed a commit to llasram/cider that referenced this issue Dec 18, 2014
Maps received via nREPL have string keys.  The Emacs Lisp text property
functions expect all property keys to be symbols.  Thus we must first intern any
non-symbol property keys prior to applying them as text properties.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants