工作不繼的clojure.test
源文檔字符串,我發出的REPL如下:clojure.test拋出?在REPL
(use 'clojure.test)
(is (thrown? ArithmeticException (/ 1 0)))
和其他變化就像java.lang.ArithmeticException代ArithmeticException。然而,這個例外從來沒有被clojure.test捕獲,而是一路冒出來:
> #error { :cause "Divide by zero" :via [{:type java.lang.ArithmeticException :message "Divide by zero" :at
> [clojure.lang.Numbers divide "Numbers.java" 158]}] :trace
> [[clojure.lang.Numbers divide "Numbers.java" 158]
> [clojure.lang.Numbers divide "Numbers.java" 3808] [api.core$eval1305
> invokeStatic "form-init8750388124499546857.clj" 1]
> [api.core$eval1305 invoke "form-init8750388124499546857.clj" 1]
> [clojure.lang.Compiler eval "Compiler.java" 6927]
> [clojure.lang.Compiler eval "Compiler.java" 6890] [clojure.core$eval
> invokeStatic "core.clj" 3105] [clojure.core$eval invoke "core.clj"
> 3101] [clojure.main$repl$read_eval_print__7408$fn__7411 invoke
> "main.clj" 240] [clojure.main$repl$read_eval_print__7408 invoke
> "main.clj" 240] [clojure.main$repl$fn__7417 invoke "main.clj" 258]
> [clojure.main$repl invokeStatic "main.clj" 258] [clojure.main$repl
> doInvoke "main.clj" 174] [clojure.lang.RestFn invoke "RestFn.java"
> 1523]
> [clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__667
> invoke "interruptible_eval.clj" 87] [clojure.lang.AFn applyToHelper
> "AFn.java" 152] [clojure.lang.AFn applyTo "AFn.java" 144]
> [clojure.core$apply invokeStatic "core.clj" 646]
> [clojure.core$with_bindings_STAR_ invokeStatic "core.clj" 1881]
> [clojure.core$with_bindings_STAR_ doInvoke "core.clj" 1881]
> [clojure.lang.RestFn invoke "RestFn.java" 425]
> [clojure.tools.nrepl.middleware.interruptible_eval$evaluate
> invokeStatic "interruptible_eval.clj" 85]
> [clojure.tools.nrepl.middleware.interruptible_eval$evaluate invoke
> "interruptible_eval.clj" 55]
> [clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__712$fn__715
> invoke "interruptible_eval.clj" 222]
> [clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__707
> invoke "interruptible_eval.clj" 190] [clojure.lang.AFn run
> "AFn.java" 22] [java.util.concurrent.ThreadPoolExecutor runWorker
> "ThreadPoolExecutor.java" 1142]
> [java.util.concurrent.ThreadPoolExecutor$Worker run
> "ThreadPoolExecutor.java" 617] [java.lang.Thread run "Thread.java"
> 745]]}
它可能是什麼? clojure.test中的其他內容可以在預期的repl中工作。
版本信息:
Leiningen 2.7.1上的Java 1.8.0_101爪哇熱點(TM)64位服務器VM
> nREPL server started on port 44025 on host 127.0.0.1 -
> nrepl://127.0.0.1:44025 REPL-y 0.3.7, nREPL 0.2.12 Clojure 1.8.0 Java
> HotSpot(TM) 64-Bit Server VM 1.8.0_101-b13
謝謝你們。看起來像https://clojure.github.io/clojure/clojure.test-api.html上的文檔字符串需要修復,不是嗎? – matanster