[#340] fix interop with PushbackInputStream

This commit is contained in:
Michiel Borkent 2020-04-11 12:24:56 +02:00 committed by GitHub
parent 9f199ddef7
commit fb53e05ba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View file

@ -8,6 +8,8 @@
:license {:name "Eclipse Public License 1.0"
:url "http://opensource.org/licenses/eclipse-1.0.php"}
:source-paths ["src" "sci/src" "babashka.curl/src"]
;; for debugging Reflector.java code:
;; :java-source-paths ["sci/reflector/src-java"]
:resource-paths ["resources" "sci/resources"]
:dependencies [[org.clojure/clojure "1.10.2-alpha1"]
[org.clojure/tools.reader "1.3.2"]

2
sci

@ -1 +1 @@
Subproject commit 31f406625481f9e74ff6ead730595cd8c7892955
Subproject commit f5161cafd86bdd4a139d5427a26e5a3fa87734b1

View file

@ -387,8 +387,14 @@
(deftest get-message-on-exception-info-test
(is "foo" (bb nil "(try (throw (ex-info \"foo\" {})) (catch Exception e (.getMessage e)))")))
(deftest pushback-reader-test
(is (= "foo" (bb nil "
(require '[clojure.java.io :as io])
(let [pb (java.io.PushbackInputStream. (java.io.ByteArrayInputStream. (.getBytes \"foo\")))]
(.unread pb (.read pb))
(slurp pb))"))))
;;;; Scratch
(comment
(dotimes [_ 10] (wait-for-port-test))
)
(dotimes [_ 10] (wait-for-port-test)))