File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
test/clojure/test_clojure Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 5223
5223
~@(when gen-class-call (list gen-class-call))
5224
5224
~@(when (and (not= name 'clojure.core) (not-any? #(= :refer-clojure (first %)) references))
5225
5225
`((clojure.core/refer '~'clojure.core)))
5226
- ~@(map process-reference references)))))
5226
+ ~@(map process-reference references))
5227
+ (if (.equals '~name 'clojure.core)
5228
+ nil
5229
+ (do (dosync (commute @#'*loaded-libs* conj '~name)) nil )))))
5227
5230
5228
5231
(defmacro refer-clojure
5229
5232
" Same as (refer 'clojure.core <filters>)"
Original file line number Diff line number Diff line change 35
35
(is (some #{'defmacro} (apropos 'defmacro)))
36
36
(is (some #{'defmacro} (apropos 'efmac)))
37
37
(is (= [] (apropos 'nothing-has-this-name)))))
38
+
39
+
40
+ (defmacro call-ns
41
+ " Call ns with a unique namespace name. Return the result of calling ns"
42
+ [] `(ns a#))
43
+ (defmacro call-ns-sym
44
+ " Call ns wih a unique namespace name. Return the namespace symbol."
45
+ [] `(do (ns a #) 'a#))
46
+
47
+ (deftest test-dynamic-ns
48
+ (testing " a call to ns returns nil"
49
+ (is (= nil (call-ns ))))
50
+ (testing " requiring a dynamically created ns should not throw an exception"
51
+ (is (= nil (let [a (call-ns-sym )] (require a))))))
You can’t perform that action at this time.
0 commit comments