Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (24 sloc) 1.088 kB
(ns swank.test-swank.commands.basic
(:refer-clojure :exclude [load-file print-doc])
(:use swank.commands.basic :reload-all)
(:use clojure.test))
(defn emacs-package-fixture [f]
(binding [swank.core/*current-package* "user"]
(f)))
(use-fixtures :each emacs-package-fixture)
(defmacro with-private-vars [[ns fns] & tests]
"Refers private fns from ns and runs tests in context. From users mailing
list, Alan Dipert and MeikelBrandmeyer."
`(let ~(reduce #(conj %1 %2 `@(ns-resolve '~ns '~%2)) [] fns)
~@tests))
(with-private-vars [swank.commands.basic
[guess-compiler-exception-location
exception-location]]
(deftest guess-compiler-exception-location-test
(is (= '(:location (:file "a.clj") (:line 1) nil)
(guess-compiler-exception-location
(compiler-exception "a.clj" 1 (Exception. "err"))))))
(deftest exception-location-test
(is (= '(:location (:file "a.clj") (:line 1) nil)
(exception-location
(compiler-exception "a.clj" 1 (Exception. "err")))))))
Jump to Line
Something went wrong with that request. Please try again.