[#1061] Calling close on DirectoryStream fails

This commit is contained in:
Michiel Borkent 2021-11-13 10:38:21 +01:00
parent 877700710a
commit 321c47297d
2 changed files with 7 additions and 2 deletions

View file

@ -425,6 +425,7 @@
(instance? java.util.Map v)
java.util.Map
;; added for issue #239 regarding clj-http-lite
;; can potentially be removed due to fix for #1061
(instance? java.io.ByteArrayOutputStream v)
java.io.ByteArrayOutputStream
(instance? java.security.MessageDigest v)
@ -458,7 +459,10 @@
;; this makes interop on reified classes work
;; see java_net_http_test/interop-test
(instance? sci.impl.types.IReified v)
(first (t/getInterfaces v)))))))
(first (t/getInterfaces v))
;; fix for #1061
(instance? java.io.Closeable v)
java.io.Closeable)))))
(def class-map (gen-class-map))

View file

@ -411,7 +411,8 @@
(is (.exists f2))
(let [v (bb nil "-f" (.getPath (io/file "test-resources" "babashka" "glob.clj")))]
(is (vector? v))
(is (.exists (io/file (first v)))))))
(is (.exists (io/file (first v)))))
(is (= :success (bb nil "(with-open [str (java.nio.file.Files/newDirectoryStream (.toPath (clojure.java.io/file \".\")))] :success)")))))
(deftest future-print-test
(testing "the root binding of sci/*out*"