From 0b8f34003826c93aa248e36e1ea93b643244cd7d Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Fri, 19 Jan 2018 00:16:07 +0200 Subject: 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. --- cider-test.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cider-test.el') 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)) -- cgit v1.2.3