Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clj/clojure/test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@
(fn []
(doseq [v vars]
(when (:test (meta v))
(each-fixture-fn (fn [] (test-var v))))))))))
(each-fixture-fn (fn [] (binding [*ns* ns] (test-var v)))))))))))

(defn test-all-vars
"Calls test-vars on every var interned in the namespace, with fixtures."
Expand Down
4 changes: 2 additions & 2 deletions test/clojure/test_clojure/ns_libs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@

(deftest test-defrecord-deftype-err-msg
(is (thrown-with-cause-msg? clojure.lang.Compiler$CompilerException
#"defrecord and deftype fields must be symbols, user\.MyRecord had: :shutdown-fn"
#"defrecord and deftype fields must be symbols, clojure\.test-clojure\.ns-libs\.MyRecord had: :shutdown-fn"
(eval '(defrecord MyRecord [:shutdown-fn]))))
(is (thrown-with-cause-msg? clojure.lang.Compiler$CompilerException
#"defrecord and deftype fields must be symbols, user\.MyType had: :key1"
#"defrecord and deftype fields must be symbols, clojure\.test-clojure\.ns-libs\.MyType had: :key1"
(eval '(deftype MyType [:key1])))))
4 changes: 2 additions & 2 deletions test/clojure/test_clojure/reader.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@
Exception #"Namespaced map must specify a valid namespace" "#:s/t{1 2}"
Exception #"Unknown auto-resolved namespace alias" "#::BOGUS{1 2}"
Exception #"Namespaced map must specify a namespace" "#: s{:a 1}"
Exception #"Duplicate key: :user/a" "#::{:a 1 :a 2}"
Exception #"Duplicate key: user/a" "#::{a 1 a 2}"))
Exception #"Duplicate key: :clojure\.test-clojure\.reader/a" "#::{:a 1 :a 2}"
Exception #"Duplicate key: clojure\.test-clojure\.reader/a" "#::{a 1 a 2}"))

(deftest namespaced-map-edn
(is (= {1 1, :a/b 2, :b/c 3, :d 4}
Expand Down
6 changes: 6 additions & 0 deletions test/clojure/test_clojure/test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,9 @@
(binding [report original-report]
(are [x y] (= x y)
((fn [x] (inc x)) 1) 2)))

(defmacro test-macro []
:expanded)

(deftest can-test-macro-expansion
(is (= :expanded (macroexpand '(test-macro))) "Should pass"))