Skip to content

Commit

Permalink
Mark Compat.Unicode from #432 and #507 for deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 221984a commit 5a06c75
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 36 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ Currently, the `@compat` macro supports the following syntaxes:

## Module Aliases

* `using Compat.Unicode` is provided on versions older than 0.7, where this library is not
yet a part of the standard library. ([#25021])

* `using Compat.Distributed` is provided on versions older than 0.7, where this library is
not yet part of the standard library ([#24443]).

Expand Down
22 changes: 4 additions & 18 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,17 @@ import Statistics
import Base: Fix2
import Base64
const tr = LinearAlgebra.tr


include("compatmacro.jl")

# 0.7.0-DEV.2915
module Unicode
export graphemes, textwidth, isvalid,
islower, isupper, isalpha, isdigit, isxdigit, isnumeric, isalnum,
iscntrl, ispunct, isspace, isprint, isgraph,
lowercase, uppercase, titlecase, lcfirst, ucfirst
using Unicode
import Unicode: isassigned, normalize # not exported from Unicode module due to conflicts
end

if VERSION < v"0.7.0-DEV.2915"
if VERSION < v"0.7.0-DEV.1930"
import ..Compat: textwidth
end

isnumeric(c::Char) = isnumber(c)
isassigned(c) = is_assigned_char(c)
normalize(s::AbstractString; kws...) = normalize_string(s; kws...)
normalize(s::AbstractString, nf::Symbol) = normalize_string(s, nf)
else
using Unicode
import Unicode: isassigned, normalize # not exported from Unicode module due to conflicts
end
end
include("compatmacro.jl")

# 0.7.0-DEV.3393
@static if VERSION < v"0.7.0-DEV.3393"
Expand Down
15 changes: 15 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,21 @@ end
# julia#26365
@test Compat.tr([1 2; 3 5]) == 6

# 0.7.0-DEV.2915
module Test25021
using Compat
using Compat.Test
using Compat.Unicode
@test isdefined(@__MODULE__, :Unicode)

@test !isnumeric('a')
@test isnumeric('1')
@test titlecase("firstname lastname") == "Firstname Lastname"
@test Compat.Unicode.isassigned('') && !Compat.Unicode.isassigned(0xfffe)
@test Compat.Unicode.normalize("\U1e9b\U0323", :NFKC) == "\U1e69"
@test Compat.Unicode.normalize("\t\r", stripcc=true) == " "
end


# tests of removed functionality (i.e. justs tests Base)

Expand Down
15 changes: 0 additions & 15 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,6 @@ let A = [1]
@test x == 1
end

# 0.7.0-DEV.2915
module Test25021
using Compat
using Compat.Test
using Compat.Unicode
@test isdefined(@__MODULE__, :Unicode)

@test !isnumeric('a')
@test isnumeric('1')
@test titlecase("firstname lastname") == "Firstname Lastname"
@test Compat.Unicode.isassigned('') && !Compat.Unicode.isassigned(0xfffe)
@test Compat.Unicode.normalize("\U1e9b\U0323", :NFKC) == "\U1e69"
@test Compat.Unicode.normalize("\t\r", stripcc=true) == " "
end

# 0.7.0-DEV.3393
@test !isnumeric('a')
@test isnumeric('1')
Expand Down

0 comments on commit 5a06c75

Please sign in to comment.