Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more coverage for UTF8String #12641

Merged
merged 2 commits into from Aug 17, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/unicode/utf8.jl
Expand Up @@ -10,3 +10,17 @@ let ch = 0x10000
end
end
end

let str = UTF8String(b"this is a test\xed\x80")
@test next(str, 15) == ('\ufffd', 16)
@test_throws BoundsError getindex(str, 0:3)
@test_throws BoundsError getindex(str, 17:18)
@test_throws BoundsError getindex(str, 2:17)
@test_throws UnicodeError getindex(str, 16:17)
@test string(Char(0x110000)) == "\ufffd"
sa = SubString{ASCIIString}("This is a silly test", 1, 14)
s8 = convert(SubString{UTF8String}, sa)
@test typeof(s8) == SubString{UTF8String}
@test s8 == "This is a sill"
@test convert(UTF8String, b"this is a test\xed\x80\x80") == "this is a test\ud000"
end