[#103] add .write and .append support for BufferedWriter
This commit is contained in:
parent
76a8e784c9
commit
8c5cc4ee67
3 changed files with 17 additions and 0 deletions
|
|
@ -17,6 +17,12 @@
|
|||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.io.BufferedWriter",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.io.BufferedReader",
|
||||
"allPublicMethods":true
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@ Everything after that is bound to *command-line-args*."))
|
|||
:classes {'java.lang.ArithmeticException ArithmeticException
|
||||
'java.lang.AssertionError AssertionError
|
||||
'java.lang.Boolean Boolean
|
||||
'java.io.BufferedWriter java.io.BufferedWriter
|
||||
'java.lang.Class Class
|
||||
'java.lang.Double Double
|
||||
'java.lang.Exception Exception
|
||||
|
|
|
|||
|
|
@ -247,3 +247,13 @@
|
|||
(bb nil "(vec (.split (java.util.regex.Pattern/compile \"f\") \"1f2f3\"))")))
|
||||
(is (= java.util.regex.Pattern/CANON_EQ
|
||||
(bb nil "java.util.regex.Pattern/CANON_EQ"))))
|
||||
|
||||
(deftest writer-test
|
||||
(let [tmp-file (java.io.File/createTempFile "bbb" "bbb")
|
||||
path (.getPath tmp-file)]
|
||||
(bb nil (format "(with-open [w (io/writer \"%s\")]
|
||||
(.write w \"foobar\n\")
|
||||
(.append w \"barfoo\n\")
|
||||
nil)"
|
||||
path))
|
||||
(is (= "foobar\nbarfoo\n" (slurp path)))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue