diff options
author | Konrad Hinsen <konrad.hinsen@laposte.net> | 2009-05-06 16:26:54 +0000 |
---|---|---|
committer | Konrad Hinsen <konrad.hinsen@laposte.net> | 2009-05-06 16:26:54 +0000 |
commit | e17240ed0a48563a6b5131ff22a2eecba3eca47f (patch) | |
tree | bb15cef05c800c0b19a287e4e48f81eb6c00a281 /src/clojure | |
parent | eec8b11cbbd53f94e510161998e54992fccb0de8 (diff) |
test_is: undo change from r761 and replace it by a fixture in test-contrib.macro-utils
Diffstat (limited to 'src/clojure')
-rw-r--r-- | src/clojure/contrib/test_contrib/macro_utils.clj | 7 | ||||
-rw-r--r-- | src/clojure/contrib/test_is.clj | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/clojure/contrib/test_contrib/macro_utils.clj b/src/clojure/contrib/test_contrib/macro_utils.clj index 47d947a5..01c64678 100644 --- a/src/clojure/contrib/test_contrib/macro_utils.clj +++ b/src/clojure/contrib/test_contrib/macro_utils.clj @@ -12,13 +12,17 @@ ;; remove this notice, or any other, from this software. (ns clojure.contrib.test-contrib.macro-utils - (:use [clojure.contrib.test-is :only (deftest is are run-tests)] + (:use [clojure.contrib.test-is :only (deftest is are run-tests use-fixtures)] [clojure.contrib.macro-utils :only (macrolet symbol-macrolet defsymbolmacro with-symbol-macros mexpand-1 mexpand mexpand-all)] [clojure.contrib.monads :only (with-monad domonad)])) +(use-fixtures :each + (fn [f] (binding [*ns* (the-ns 'clojure.contrib.test-contrib.macro-utils)] + (f)))) + (deftest macrolet-test (is (= (macroexpand-1 '(macrolet [(foo [form] `(~form ~form))] (foo x))) @@ -60,3 +64,4 @@ (is (= (macroexpand '(macrolet [(plus [a b] `(+ ~a ~b))] (+ 1 sum-2-3))) '(do (+ 1 (clojure.core/+ 2 3))))) (ns-unmap *ns* 'sum-2-3)) + diff --git a/src/clojure/contrib/test_is.clj b/src/clojure/contrib/test_is.clj index c56cdbbe..a7b2604b 100644 --- a/src/clojure/contrib/test_is.clj +++ b/src/clojure/contrib/test_is.clj @@ -892,16 +892,13 @@ Chas Emerick, Allen Rohner, and Stuart Halloway", *report-counters*." [ns] (binding [*report-counters* (ref *initial-report-counters*)] - (let [current-ns *ns* - ns (if (symbol? ns) (find-ns ns) ns)] + (let [ns (if (symbol? ns) (find-ns ns) ns)] (report {:type :begin-test-ns, :ns ns}) - (in-ns (ns-name ns)) ;; If ns has a test-ns-hook function, call that: (if-let [v (find-var (symbol (str (ns-name ns)) "test-ns-hook"))] ((var-get v)) ;; Otherwise, just test every var in the ns. (test-all-vars ns)) - (in-ns (ns-name current-ns)) (report {:type :end-test-ns, :ns ns})) @*report-counters*)) |