Skip to content

Commit 6a27cc3

Browse files
committed
Use low-endian in tests too
Else previous commit wouldn't fix anything.
1 parent 9ee12ff commit 6a27cc3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/runtests.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ for s in ("", "a", "café crème",
55
"a"^(iconv.BUFSIZE-1) * "€ with an incomplete codepoint between two input buffer fills",
66
"a string € チャネルパートナーの選択")
77
# Test round-trip to Unicode formats, checking against pure-Julia implementation
8-
for (T, enc) in ((UTF8String, "UTF-8"), (UTF16String, "UTF-16"), (UTF32String, "UTF-32"))
8+
for T in (UTF8String, UTF16String, UTF32String)
9+
enc = iconv.encoding_string(T)
910
a = reinterpret(UInt8, T(s).data)
1011
@test decode(a, enc) == s
1112
@test decode(encode(s, enc), enc) == s
@@ -21,11 +22,11 @@ end
2122
# Test that attempt to close stream in the middle of incomplete sequence throws
2223
# TODO: use more specific errors
2324
let s = "a string € チャネルパートナーの選択"
24-
p = StringEncoder(IOBuffer(), "UTF-16")
25+
p = StringEncoder(IOBuffer(), "UTF-16LE")
2526
write(p, s.data[1:10])
2627
@test_throws ErrorException close(p)
2728

28-
p = StringDecoder(IOBuffer(encode(s, "UTF-16")[1:21]), "UTF-16")
29+
p = StringDecoder(IOBuffer(encode(s, "UTF-16LE")[1:19]), "UTF-16LE")
2930
@test readall(p) == s[1:9]
3031
@test_throws ErrorException close(p)
3132

0 commit comments

Comments
 (0)