summaryrefslogtreecommitdiff
path: root/cider-test.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2018-01-19 00:16:07 +0200
committerBozhidar Batsov <bozhidar@batsov.com>2018-01-19 00:16:07 +0200
commit0b8f34003826c93aa248e36e1ea93b643244cd7d (patch)
treed04b6df2f88cee4881b528acbcf86679af368023 /cider-test.el
parent75a187d83e2dba65537d130b6d4eee7faa8108fd (diff)
Highlight failed assertions in tests that were defined interactively
Originally nREPL wasn't setting location metadata for vars defined interactively, but this was changed at some point (I forgot the exact nREPL version). We could have fixed this a long time ago, but I guess nobody paid it any attention.
Diffstat (limited to 'cider-test.el')
-rw-r--r--cider-test.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/cider-test.el b/cider-test.el
index fa25ecd8..7e9def44 100644
--- a/cider-test.el
+++ b/cider-test.el
@@ -492,11 +492,11 @@ The optional arg TEST denotes an individual test name."
(defun cider-test-highlight-problem (buffer test)
"Highlight the BUFFER test definition for the non-passing TEST."
(with-current-buffer buffer
- (nrepl-dbind-response test (type file line message expected actual)
- ;; we have to watch out for vars without proper location metadata
- ;; right now everything evaluated interactively lacks this data
- ;; TODO: Figure out what to do when the metadata is missing
- (when (and file line (not (cider--tooling-file-p file)))
+ ;; we don't need the file name here, as we always operate on the current
+ ;; buffer and the line data is correct even for vars that were
+ ;; defined interactively
+ (nrepl-dbind-response test (type line message expected actual)
+ (when line
(save-excursion
(goto-char (point-min))
(forward-line (1- line))