Permalink
Browse files

Fix bug suppressing test report output in repl.

  • Loading branch information...
1 parent bf8c632 commit c8c684e3eddfc3f5294ef70030007393cf077dfc @technomancy technomancy committed Oct 14, 2009
Showing with 13 additions and 9 deletions.
  1. +3 −3 clojure-mode.el
  2. +10 −6 clojure-test-mode.el
View
@@ -18,9 +18,9 @@
;;; Installation:
-;; If you use ELPA, you can install via the M-x package-list-packages
-;; interface. This is preferrable as you will have access to updates
-;; automatically.
+;; If you use ELPA (http://tromey.com/elpa), you can install via the
+;; M-x package-list-packages interface. This is preferrable as you
+;; will have access to updates automatically.
;; If you need to install by hand for some reason:
View
@@ -75,7 +75,8 @@
;; * Add clojure-test-jump-to-(test|implementation).
;; 1.3: ???
-;; * Support clojure.contrib.test-is and clojure.test.
+;; * Update to use clojure.test instead of clojure.contrib.test-is.
+;; * Fix bug suppressing test report output in repl.
;;; TODO:
@@ -145,7 +146,8 @@
(str (:expected event))
(str (:actual event))
((file-position 2) 1)])))
- (old-report event))"))
+ (binding [*test-out* *out*]
+ (old-report event)))"))
(defun clojure-test-get-results (result)
(clojure-test-eval
@@ -156,7 +158,6 @@
(defun clojure-test-extract-results (results)
(let ((result-vars (read (cadr results))))
- (setq the-result result-vars)
;; slime-eval-async hands us a cons with a useless car
(mapcar #'clojure-test-extract-result result-vars)
(message "Ran %s tests. %s failures, %s errors."
@@ -178,7 +179,6 @@
(clojure-test-highlight-problem line event actual)))))))
(defun clojure-test-highlight-problem (line event message)
- ;; (add-to-list 'the-results (list line event message))
(save-excursion
(goto-line line)
(set-mark-command nil)
@@ -189,6 +189,8 @@
'clojure-test-error-face))
(overlay-put overlay 'message message))))
+;; File navigation
+
(defun clojure-test-implementation-for (namespace)
(let* ((segments (split-string namespace "\\."))
(common-segments (butlast segments 2))
@@ -213,8 +215,10 @@
(clojure-test-eval (format "(load-file \"%s\")"
(buffer-file-name))
(lambda (&rest args)
- (clojure-test-eval "(clojure.test/run-tests)"
- #'clojure-test-get-results))))))
+ ;; clojure-test-eval will wrap in with-out-str
+ (slime-eval-async `(swank:interactive-eval
+ "(clojure.test/run-tests)")
+ #'clojure-test-get-results))))))
(defun clojure-test-show-result ()
"Show the result of the test under point."

0 comments on commit c8c684e

Please sign in to comment.