diff --git a/test/clojure/test_clojure/rt.clj b/test/clojure/test_clojure/rt.clj index 6f2890e9..180f654a 100644 --- a/test/clojure/test_clojure/rt.clj +++ b/test/clojure/test_clojure/rt.clj @@ -104,25 +104,33 @@ (is (nil? ('subset? (ns-publics ns)))) (is (= #'clojure.set/subset? ('subset? (ns-refers ns))))))) +(defmacro silenced [& forms] + `(binding [*err* (new java.io.StringWriter)] + ~@forms)) + (deftest var-meta-tests (testing "Var.resetMeta should clear flags, getters" (let [v (def a-test-v)] - (do (.resetMeta v {}) + (do (silenced + (.resetMeta v {})) (is (.isPublic v)) (is (not (.isDynamic v))) (is (not (.isMacro v)))) - (do (.resetMeta v {:private true}) + (do (silenced + (.resetMeta v {:private true})) (is (not (.isPublic v))) (is (not (.isDynamic v))) (is (not (.isMacro v)))) - (do (.resetMeta v {:dynamic true}) + (do (silenced + (.resetMeta v {:dynamic true})) (is (.isPublic v)) (is (.isDynamic v)) (is (not (.isMacro v)))) - (do (.resetMeta v {:macro true}) + (do (silenced + (.resetMeta v {:macro true})) (is (.isPublic v)) (is (not (.isDynamic v))) (is (.isMacro v))))))