Skip to content

Commit c269f3b

Browse files
committed
Fix deprecation warning about takebuf_*() functions
1 parent 97ef9d2 commit c269f3b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
julia 0.5
22
BinDeps
3-
Compat 0.8.0
3+
Compat 0.10.0
44
@windows WinRPM
55
LegacyStrings 0.1.1

src/StringEncodings.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ function encode(s::AbstractString, enc::Encoding)
485485
p = StringEncoder(b, enc, encoding(typeof(s)))
486486
write(p, s)
487487
flush(p)
488-
takebuf_array(b)
488+
take!(b)
489489
end
490490

491491
encode(s::AbstractString, enc::AbstractString) = encode(s, Encoding(enc))

test/runtests.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ let s = "a string チャネルパートナーの選択", a = Vector{UInt8}(s)
5454
@test isa(err, IncompleteSequenceError)
5555
io = IOBuffer()
5656
showerror(io, err)
57-
@test takebuf_string(io) == "Incomplete byte sequence at end of input"
57+
@test String(take!(io)) == "Incomplete byte sequence at end of input"
5858
end
5959

6060
b = IOBuffer(encode(s, "UTF-16LE")[1:19])
@@ -86,7 +86,7 @@ try
8686
catch err
8787
io = IOBuffer()
8888
showerror(io, err)
89-
@test takebuf_string(io) ==
89+
@test String(take!(io)) ==
9090
"Byte sequence 0xc3a9e282ac is invalid in source encoding or cannot be represented in target encoding"
9191
end
9292

@@ -96,7 +96,7 @@ try
9696
catch err
9797
io = IOBuffer()
9898
showerror(io, err)
99-
@test takebuf_string(io) ==
99+
@test String(take!(io)) ==
100100
"Byte sequence 0xc3a9e282ac is invalid in source encoding or cannot be represented in target encoding"
101101
end
102102

@@ -107,7 +107,7 @@ let x = encode("ÄÆä", "ISO-8859-1")
107107
catch err
108108
io = IOBuffer()
109109
showerror(io, err)
110-
@test takebuf_string(io) ==
110+
@test String(take!(io)) ==
111111
"Byte sequence 0xc4c6e4 is invalid in source encoding or cannot be represented in target encoding"
112112
end
113113
end
@@ -128,7 +128,7 @@ catch err
128128
@test isa(err, InvalidEncodingError)
129129
io = IOBuffer()
130130
showerror(io, err)
131-
@test takebuf_string(io) ==
131+
@test String(take!(io)) ==
132132
"Conversion from absurd_encoding to nonexistent_encoding not supported by iconv implementation, check that specified encodings are correct"
133133
end
134134
try
@@ -137,7 +137,7 @@ catch err
137137
@test isa(err, InvalidEncodingError)
138138
io = IOBuffer()
139139
showerror(io, err)
140-
@test takebuf_string(io) ==
140+
@test String(take!(io)) ==
141141
"Conversion from nonexistent_encoding to absurd_encoding not supported by iconv implementation, check that specified encodings are correct"
142142
end
143143

@@ -189,7 +189,7 @@ end
189189
## Test encodings support
190190
b = IOBuffer()
191191
show(b, enc"UTF-8")
192-
@test takebuf_string(b) == "UTF-8 string encoding"
192+
@test String(take!(b)) == "UTF-8 string encoding"
193193
@test string(enc"UTF-8") == "UTF-8"
194194

195195
encodings_list = encodings()

0 commit comments

Comments
 (0)