File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
test/clojure/test_clojure/java Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 260260 IOFactory
261261 (assoc default-streams-impl
262262 :make-input-stream (fn [^Socket x opts] (.getInputStream x))
263- :output-stream (fn [^Socket x opts] (output-stream ( .getOutputStream x) opts ))))
263+ :make- output-stream (fn [^Socket x opts] (.getOutputStream x))))
264264
265265(extend byte-array-type
266266 IOFactory
Original file line number Diff line number Diff line change 88
99(ns clojure.test-clojure.java.io
1010 (:use clojure.test clojure.java.io)
11- (:import (java.io File FileInputStream BufferedInputStream
12- FileOutputStream OutputStreamWriter InputStreamReader
11+ (:import (java.io File BufferedInputStream
12+ FileInputStream InputStreamReader InputStream
13+ FileOutputStream OutputStreamWriter OutputStream
1314 ByteArrayInputStream ByteArrayOutputStream)
14- (java.net URL URI)))
15+ (java.net URL URI Socket ServerSocket )))
1516
1617(defn temp-file
1718 [prefix suffix]
193194 (is (not (.isDirectory (file tmp " test-make-parents" " child" " grandchild" ))))
194195 (delete-file (file tmp " test-make-parents" " child" ))
195196 (delete-file (file tmp " test-make-parents" ))))
197+
198+ (deftest test-socket-iofactory
199+ (let [port 65321
200+ server-socket (ServerSocket. port)
201+ client-socket (Socket. " localhost" port)]
202+ (try
203+ (is (instance? InputStream (input-stream client-socket)))
204+ (is (instance? OutputStream (output-stream client-socket)))
205+ (finally (.close server-socket)
206+ (.close client-socket)))))
You can’t perform that action at this time.
0 commit comments