Fix #1367: line number in clojure.test output
This commit is contained in:
parent
aa0da8f503
commit
3b5dbb7c66
5 changed files with 25 additions and 12 deletions
2
sci
2
sci
|
|
@ -1 +1 @@
|
||||||
Subproject commit 584a4ab5fef1aaa84aedab29c28153c7b178eb59
|
Subproject commit 2b8751f8443948e618dfab354e980aadc912dcc4
|
||||||
|
|
@ -232,13 +232,13 @@
|
||||||
For additional event types, see the examples in the code.
|
For additional event types, see the examples in the code.
|
||||||
"}
|
"}
|
||||||
babashka.impl.clojure.test
|
babashka.impl.clojure.test
|
||||||
(:require [babashka.impl.common :refer [ctx]]
|
(:require
|
||||||
[clojure.stacktrace :as stack]
|
[babashka.impl.common :refer [ctx]]
|
||||||
[clojure.template :as temp]
|
[clojure.stacktrace :as stack]
|
||||||
[sci.core :as sci]
|
[clojure.template :as temp]
|
||||||
[sci.impl.namespaces :as sci-namespaces]
|
[sci.core :as sci]
|
||||||
[sci.impl.resolve :as resolve]
|
[sci.impl.namespaces :as sci-namespaces]
|
||||||
[sci.impl.vars :as vars]))
|
[sci.impl.resolve :as resolve]))
|
||||||
|
|
||||||
;; Nothing is marked "private" here, so you can rebind things to plug
|
;; Nothing is marked "private" here, so you can rebind things to plug
|
||||||
;; in your own testing or reporting frameworks.
|
;; in your own testing or reporting frameworks.
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,9 @@
|
||||||
:wait-for-port.impl/timed-out
|
:wait-for-port.impl/timed-out
|
||||||
:wait-for-port.impl/try-again))))]
|
:wait-for-port.impl/try-again))))]
|
||||||
(cond (identical? :wait-for-port.impl/try-again v)
|
(cond (identical? :wait-for-port.impl/try-again v)
|
||||||
(do (Thread/sleep (or pause 100))
|
(let [^long pause (or pause 100)]
|
||||||
(recur))
|
(Thread/sleep pause)
|
||||||
|
(recur))
|
||||||
(identical? :wait-for-port.impl/timed-out v)
|
(identical? :wait-for-port.impl/timed-out v)
|
||||||
default
|
default
|
||||||
:else
|
:else
|
||||||
|
|
@ -51,8 +52,9 @@
|
||||||
:wait-for-path.impl/timed-out
|
:wait-for-path.impl/timed-out
|
||||||
:wait-for-path.impl/try-again)))]
|
:wait-for-path.impl/try-again)))]
|
||||||
(cond (identical? :wait-for-path.impl/try-again v)
|
(cond (identical? :wait-for-path.impl/try-again v)
|
||||||
(do (Thread/sleep (or pause 100))
|
(let [^long pause (or pause 100)]
|
||||||
(recur))
|
(Thread/sleep pause)
|
||||||
|
(recur))
|
||||||
(identical? :wait-for-path.impl/timed-out v)
|
(identical? :wait-for-path.impl/timed-out v)
|
||||||
default
|
default
|
||||||
:else
|
:else
|
||||||
|
|
|
||||||
7
test-resources/line_number_test_test.clj
Normal file
7
test-resources/line_number_test_test.clj
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
(ns line-number-test-test
|
||||||
|
(:require [clojure.test :refer [is deftest run-tests]]))
|
||||||
|
|
||||||
|
(deftest test-is
|
||||||
|
(is false))
|
||||||
|
|
||||||
|
(run-tests 'line-number-test-test)
|
||||||
|
|
@ -108,3 +108,7 @@
|
||||||
(t/with-test-out (t/run-tests *ns*)))
|
(t/with-test-out (t/run-tests *ns*)))
|
||||||
(str/includes? (str sw) \"Ran 1 tests containing 2 assertions.\"))")]
|
(str/includes? (str sw) \"Ran 1 tests containing 2 assertions.\"))")]
|
||||||
(is (str/includes? output "true"))))
|
(is (str/includes? output "true"))))
|
||||||
|
|
||||||
|
(deftest line-number-test
|
||||||
|
(is (str/includes? (bb "test-resources/line_number_test_test.clj")
|
||||||
|
"line_number_test_test.clj:4")))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue