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

Move back iscased function to Base.Unicode #26351

Merged
merged 2 commits into from
Mar 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,11 @@ function isupper(c::AbstractChar)
cat == UTF8PROC_CATEGORY_LU || cat == UTF8PROC_CATEGORY_LT
end

# Documented in Unicode module
"""
iscased(c::AbstractChar) -> Bool

Tests whether a character is cased, i.e. is lower-, upper- or title-cased.
"""
function iscased(c::AbstractChar)
cat = category_code(c)
return cat == UTF8PROC_CATEGORY_LU ||
Expand Down
7 changes: 0 additions & 7 deletions stdlib/Unicode/src/Unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ true
"""
isassigned(c) = Base.Unicode.isassigned(c)

"""
iscased(c::AbstractChar) -> Bool

Tests whether a character is cased, i.e. is lower-, upper- or title-cased.
"""
iscased(c::AbstractChar) = Base.Unicode.iscased(c)

"""
graphemes(s::AbstractString) -> GraphemeIterator

Expand Down
4 changes: 2 additions & 2 deletions stdlib/Unicode/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Test
using Unicode
using Unicode: normalize, isassigned, iscased
using Unicode: normalize, isassigned

@testset "string normalization" begin
# normalize (Unicode normalization etc.):
Expand Down Expand Up @@ -376,7 +376,7 @@ end
@test titlecase("abcD EFG\n\thij", strict=true) == "Abcd Efg\n\tHij"
@test titlecase("abcD EFG\n\thij", strict=false) == "AbcD EFG\n\tHij"
@test titlecase("abc-def") == "Abc-Def"
@test titlecase("abc-def", wordsep = !iscased) == "Abc-Def"
@test titlecase("abc-def", wordsep = !Base.Unicode.iscased) == "Abc-Def"
@test titlecase("abc-def", wordsep = isspace) == "Abc-def"
end
end
Expand Down