Skip to content

Commit 0cbf1c7

Browse files
committed
update per JuliaLang#14660
1 parent 81c7081 commit 0cbf1c7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/read.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ l = Vector{Tuple{AbstractString,Function}}()
1212

1313
# File
1414
io = (text) -> begin
15-
open(io-> write(io, text), filename, "w")
15+
write(filename, text)
1616
Base.Filesystem.open(filename, Base.Filesystem.JL_O_RDONLY)
1717
end
1818
s = io(text)
@@ -24,7 +24,7 @@ push!(l, ("File", io))
2424

2525
# IOStream
2626
io = (text) -> begin
27-
open(io-> write(io, text), filename, "w")
27+
write(filename, text)
2828
open(filename)
2929
end
3030
s = io(text)
@@ -100,7 +100,7 @@ push!(l, ("PipeEndpoint", io))
100100

101101
# Pipe
102102
io = (text) -> begin
103-
open(io->write(io, text), filename, "w")
103+
write(filename, text)
104104
open(`$(@windows ? "type" : "cat") $filename`)[1]
105105
# Was open(`echo -n $text`)[1]
106106
# See https://github.com/JuliaLang/julia/issues/14747
@@ -136,9 +136,9 @@ for (name, f) in l
136136

137137
verbose && println("$name read...")
138138
@test read(io(), UInt8) == read(IOBuffer(text), UInt8)
139-
@test read(io(), UInt8) == open(io->read(io, UInt8), filename)
139+
@test read(io(), UInt8) == read(filename, UInt8)
140140
@test read(io(), Int) == read(IOBuffer(text), Int)
141-
@test read(io(), Int) == open(io->read(io,Int),filename)
141+
@test read(io(), Int) == read(filename,Int)
142142
cleanup()
143143
s1 = io()
144144
s2 = IOBuffer(text)
@@ -176,12 +176,12 @@ for (name, f) in l
176176
UTF8String(['A' + i % 52 for i in 1:( Base.SZ_UNBUFFERED_IO +1)])
177177
]
178178

179-
verbose && println("$name readall...")
180-
@test readall(io()) == text
179+
verbose && println("$name readstring...")
180+
@test readstring(io()) == text
181181
cleanup()
182182

183-
verbose && println("$name readbytes...")
184-
@test readbytes(io()) == Vector{UInt8}(text)
183+
verbose && println("$name read...")
184+
@test read(io()) == Vector{UInt8}(text)
185185
cleanup()
186186

187187
verbose && println("$name readbytes!...")
@@ -259,7 +259,7 @@ for (name, f) in l
259259
cleanup()
260260
end
261261
verbose && println("$name seekend...")
262-
@test readall(seekend(io())) == ""
262+
@test readstring(seekend(io())) == ""
263263
end
264264

265265
cleanup()

0 commit comments

Comments
 (0)