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 isuppercase, islowercase, uppercasefirst and lowercasefirst #516

Merged
merged 1 commit into from
Mar 15, 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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ Currently, the `@compat` macro supports the following syntaxes:

* `LinSpace` is now `LinRange` ([#25896]).

* `isupper`, `islower`, `ucfirst` and `lcfirst` are now `isuppercase`, `islowercase`,
`uppercasefirst` and `lowercasefirst` ([#26442]).

## New macros

* `@__DIR__` has been added ([#18380])
Expand Down Expand Up @@ -596,3 +599,4 @@ includes this fix. Find the minimum version from there.
[#26149]: https://github.com/JuliaLang/julia/issues/26149
[#26156]: https://github.com/JuliaLang/julia/issues/26156
[#26316]: https://github.com/JuliaLang/julia/issues/26316
[#26442]: https://github.com/JuliaLang/julia/issues/26442
8 changes: 8 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1679,6 +1679,14 @@ else
const indexin = Base.indexin
end

if VERSION < v"0.7.0-DEV.4585"
export isuppercase, islowercase, uppercasefirst, lowercasefirst
const isuppercase = isupper
const islowercase = islower
const uppercasefirst = ucfirst
const lowercasefirst = lcfirst
end

include("deprecated.jl")

end # module Compat
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1491,4 +1491,12 @@ end
# 0.7.0-DEV.3972
@test Compat.indexin([1, 2], [1, 0, 1]) == [1, nothing]

# 0.7.0-DEV.4585
@test isuppercase('A')
@test !isuppercase('a')
@test islowercase('a')
@test !islowercase('A')
@test uppercasefirst("qwerty") == "Qwerty"
@test lowercasefirst("Qwerty") == "qwerty"

nothing