@@ -63,6 +63,21 @@ using Base.Test
63
63
@test read (stream, UInt8) == data[3 ]
64
64
skip (stream, 5 )
65
65
@test read (stream, UInt8) == data[9 ]
66
+ skip (stream, 7 )
67
+ @test eof (stream)
68
+ close (stream)
69
+
70
+ # skip offset > bufsize
71
+ data = collect (0x00 : 0x0f )
72
+ stream = TranscodingStream (Identity (), IOBuffer (data), bufsize= 2 )
73
+ @test read (stream, UInt8) == data[1 ]
74
+ skip (stream, 4 )
75
+ @test read (stream, UInt8) == data[6 ]
76
+ skip (stream, 3 )
77
+ @test read (stream, UInt8) == data[10 ]
78
+ skip (stream, 6 )
79
+ @test eof (stream)
80
+ close (stream)
66
81
67
82
s = TranscodingStream (Identity (), IOBuffer (b " baz" ))
68
83
@test endof (s. state. buffer1) == 0
@@ -94,6 +109,8 @@ using Base.Test
94
109
TranscodingStreams. test_roundtrip_read (IdentityStream, IdentityStream)
95
110
TranscodingStreams. test_roundtrip_write (IdentityStream, IdentityStream)
96
111
TranscodingStreams. test_roundtrip_lines (IdentityStream, IdentityStream)
112
+
113
+ @test_throws ArgumentError TranscodingStream (Identity (), IOBuffer (), bufsize= 0 )
97
114
end
98
115
99
116
for pkg in [" CodecZlib" , " CodecBzip2" , " CodecXz" , " CodecZstd" ]
0 commit comments