Skip to content

Commit

Permalink
Added new tests for full coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPJones committed Jun 19, 2015
1 parent 45ee767 commit 192bb91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/utf16.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function map(fun, str::UTF16String)
throw(UnicodeError(UTF_ERR_MAP_CHAR, 0, 0))
uc = reinterpret(UInt32, c2)
if uc < 0x10000
utf16_is_surrogate(uc) &&
utf16_is_surrogate(UInt16(uc)) &&
throw(UnicodeError(UTF_ERR_INVALID_CHAR, 0, uc))
push!(buf, UInt16(uc))
elseif uc <= 0x10ffff
Expand Down
2 changes: 1 addition & 1 deletion test/strings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ end

foomap(ch) = (ch > 65)
foobar(ch) = Char(0xd800)
foobaz(ch) = Char(0x20000)
foobaz(ch) = Char(0x200000)
@test_throws UnicodeError map(foomap, utf16("abcdef"))
@test_throws UnicodeError map(foobar, utf16("abcdef"))
@test_throws UnicodeError map(foobaz, utf16("abcdef"))

0 comments on commit 192bb91

Please sign in to comment.