Fix #1367: line number in clojure.test output

This commit is contained in:
Michiel Borkent 2022-09-22 14:03:12 +02:00
parent aa0da8f503
commit 3b5dbb7c66
5 changed files with 25 additions and 12 deletions

2
sci

@ -1 +1 @@
Subproject commit 584a4ab5fef1aaa84aedab29c28153c7b178eb59
Subproject commit 2b8751f8443948e618dfab354e980aadc912dcc4

View file

@ -232,13 +232,13 @@
For additional event types, see the examples in the code.
"}
babashka.impl.clojure.test
(:require [babashka.impl.common :refer [ctx]]
[clojure.stacktrace :as stack]
[clojure.template :as temp]
[sci.core :as sci]
[sci.impl.namespaces :as sci-namespaces]
[sci.impl.resolve :as resolve]
[sci.impl.vars :as vars]))
(:require
[babashka.impl.common :refer [ctx]]
[clojure.stacktrace :as stack]
[clojure.template :as temp]
[sci.core :as sci]
[sci.impl.namespaces :as sci-namespaces]
[sci.impl.resolve :as resolve]))
;; Nothing is marked "private" here, so you can rebind things to plug
;; in your own testing or reporting frameworks.

View file

@ -26,8 +26,9 @@
:wait-for-port.impl/timed-out
:wait-for-port.impl/try-again))))]
(cond (identical? :wait-for-port.impl/try-again v)
(do (Thread/sleep (or pause 100))
(recur))
(let [^long pause (or pause 100)]
(Thread/sleep pause)
(recur))
(identical? :wait-for-port.impl/timed-out v)
default
:else
@ -51,8 +52,9 @@
:wait-for-path.impl/timed-out
:wait-for-path.impl/try-again)))]
(cond (identical? :wait-for-path.impl/try-again v)
(do (Thread/sleep (or pause 100))
(recur))
(let [^long pause (or pause 100)]
(Thread/sleep pause)
(recur))
(identical? :wait-for-path.impl/timed-out v)
default
:else

View 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)

View file

@ -108,3 +108,7 @@
(t/with-test-out (t/run-tests *ns*)))
(str/includes? (str sw) \"Ran 1 tests containing 2 assertions.\"))")]
(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")))