File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
test/clojure/test_clojure Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,9 @@ itself (not its value) is returned. The reader macro #'x expands to (var x)."}})
150150 (read [] (let [i (proxy-super read)]
151151 (.append text (char i))
152152 i)))]
153- (read (PushbackReader. pbr))
153+ (if (= :unknown *read-eval*)
154+ (throw (IllegalStateException. " Unable to read source while *read-eval* is :unknown." ))
155+ (read (PushbackReader. pbr)))
154156 (str text)))))))
155157
156158(defmacro source
Original file line number Diff line number Diff line change 1515 (is (= (platform-newlines " (defn foo [])\n " ) (with-out-str (source clojure.test-clojure.repl.example/foo))))
1616 (is (nil? (source-fn 'non-existent-fn))))
1717
18+ (deftest test-source-read-eval-unknown
19+ (is (thrown? IllegalStateException (binding [*read-eval* :unknown ] (source reduce)))))
20+
21+ (deftest test-source-read-eval-false
22+ (is (binding [*read-eval* false ] (with-out-str (source reduce)))))
23+
1824(deftest test-dir
1925 (is (thrown? Exception (dir-fn 'non-existent-ns)))
2026 (is (= '[bar foo] (dir-fn 'clojure.test-clojure.repl.example)))
You can’t perform that action at this time.
0 commit comments