11using Base. Test
2+ import Compat: readstring
23using StringEncodings
34
45for s in (" " , " \0 " , " a" , " café crème" ,
@@ -46,7 +47,7 @@ let s = "a string チャネルパートナーの選択"
4647 end
4748
4849 p = StringDecoder (IOBuffer (encode (s, " UTF-16LE" )[1 : 19 ]), " UTF-16LE" )
49- @test readall (p) == s[1 : 9 ]
50+ @test readstring (p) == s[1 : 9 ]
5051 @test_throws IncompleteSequenceError close (p)
5152
5253 # Test stateful encoding, which output some bytes on final reset
@@ -102,7 +103,7 @@ mktemp() do p, io
102103 s = " café crème"
103104 write (io, encode (s, " CP1252" ))
104105 close (io)
105- @test readall (p, enc " CP1252" ) == s
106+ @test readstring (p, enc " CP1252" ) == s
106107end
107108
108109@test_throws InvalidEncodingError p = StringEncoder (IOBuffer (), " nonexistent_encoding" )
@@ -127,10 +128,6 @@ catch err
127128 " Conversion from nonexistent_encoding to UTF-8 not supported by iconv implementation, check that specified encodings are correct"
128129end
129130
130- if ! isdefined (Base, :readstring )
131- readstring = readall
132- end
133-
134131mktemp () do path, io
135132 s = " a string \0 チャネルパ\0 ー\0 トナーの選択 with embedded and trailing nuls\0 "
136133 write (io, encode (s, " ISO-2022-JP" ))
0 commit comments