Skip to content

Commit 0f493e2

Browse files
committed
Add extra tests to improve coverage
1 parent 49f1370 commit 0f493e2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/runtests.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,23 @@ end
106106
@test_throws InvalidEncodingError p = StringEncoder(IOBuffer(), "nonexistent_encoding")
107107
@test_throws InvalidEncodingError p = StringDecoder(IOBuffer(), "nonexistent_encoding")
108108

109+
try
110+
p = StringEncoder(IOBuffer(), "nonexistent_encoding")
111+
catch err
112+
@test isa(err, InvalidEncodingError)
113+
io = IOBuffer()
114+
showerror(io, err)
115+
@test takebuf_string(io) ==
116+
"Conversion from UTF-8 to nonexistent_encoding not supported by iconv implementation, check that specified encodings are correct"
117+
end
118+
try
119+
p = StringDecoder(IOBuffer(), "nonexistent_encoding")
120+
catch err
121+
@test isa(err, InvalidEncodingError)
122+
io = IOBuffer()
123+
showerror(io, err)
124+
@test takebuf_string(io) ==
125+
"Conversion from nonexistent_encoding to UTF-8 not supported by iconv implementation, check that specified encodings are correct"
126+
end
127+
109128
nothing

0 commit comments

Comments
 (0)