Skip to content

Commit 5a06c75

Browse files
committed
Mark Compat.Unicode from #432 and #507 for deprecation
1 parent 221984a commit 5a06c75

File tree

4 files changed

+19
-36
lines changed

4 files changed

+19
-36
lines changed

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ Currently, the `@compat` macro supports the following syntaxes:
5252

5353
## Module Aliases
5454

55-
* `using Compat.Unicode` is provided on versions older than 0.7, where this library is not
56-
yet a part of the standard library. ([#25021])
57-
5855
* `using Compat.Distributed` is provided on versions older than 0.7, where this library is
5956
not yet part of the standard library ([#24443]).
6057

src/Compat.jl

+4-18
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,17 @@ import Statistics
3434
import Base: Fix2
3535
import Base64
3636
const tr = LinearAlgebra.tr
37-
38-
39-
include("compatmacro.jl")
40-
41-
# 0.7.0-DEV.2915
4237
module Unicode
4338
export graphemes, textwidth, isvalid,
4439
islower, isupper, isalpha, isdigit, isxdigit, isnumeric, isalnum,
4540
iscntrl, ispunct, isspace, isprint, isgraph,
4641
lowercase, uppercase, titlecase, lcfirst, ucfirst
42+
using Unicode
43+
import Unicode: isassigned, normalize # not exported from Unicode module due to conflicts
44+
end
4745

48-
if VERSION < v"0.7.0-DEV.2915"
49-
if VERSION < v"0.7.0-DEV.1930"
50-
import ..Compat: textwidth
51-
end
5246

53-
isnumeric(c::Char) = isnumber(c)
54-
isassigned(c) = is_assigned_char(c)
55-
normalize(s::AbstractString; kws...) = normalize_string(s; kws...)
56-
normalize(s::AbstractString, nf::Symbol) = normalize_string(s, nf)
57-
else
58-
using Unicode
59-
import Unicode: isassigned, normalize # not exported from Unicode module due to conflicts
60-
end
61-
end
47+
include("compatmacro.jl")
6248

6349
# 0.7.0-DEV.3393
6450
@static if VERSION < v"0.7.0-DEV.3393"

test/old.jl

+15
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,21 @@ end
168168
# julia#26365
169169
@test Compat.tr([1 2; 3 5]) == 6
170170

171+
# 0.7.0-DEV.2915
172+
module Test25021
173+
using Compat
174+
using Compat.Test
175+
using Compat.Unicode
176+
@test isdefined(@__MODULE__, :Unicode)
177+
178+
@test !isnumeric('a')
179+
@test isnumeric('1')
180+
@test titlecase("firstname lastname") == "Firstname Lastname"
181+
@test Compat.Unicode.isassigned('') && !Compat.Unicode.isassigned(0xfffe)
182+
@test Compat.Unicode.normalize("\U1e9b\U0323", :NFKC) == "\U1e69"
183+
@test Compat.Unicode.normalize("\t\r", stripcc=true) == " "
184+
end
185+
171186

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

test/runtests.jl

-15
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,6 @@ let A = [1]
8080
@test x == 1
8181
end
8282

83-
# 0.7.0-DEV.2915
84-
module Test25021
85-
using Compat
86-
using Compat.Test
87-
using Compat.Unicode
88-
@test isdefined(@__MODULE__, :Unicode)
89-
90-
@test !isnumeric('a')
91-
@test isnumeric('1')
92-
@test titlecase("firstname lastname") == "Firstname Lastname"
93-
@test Compat.Unicode.isassigned('') && !Compat.Unicode.isassigned(0xfffe)
94-
@test Compat.Unicode.normalize("\U1e9b\U0323", :NFKC) == "\U1e69"
95-
@test Compat.Unicode.normalize("\t\r", stripcc=true) == " "
96-
end
97-
9883
# 0.7.0-DEV.3393
9984
@test !isnumeric('a')
10085
@test isnumeric('1')

0 commit comments

Comments
 (0)