diff --git a/README.md b/README.md index ffe922c35..18138f0fe 100644 --- a/README.md +++ b/README.md @@ -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]). diff --git a/src/Compat.jl b/src/Compat.jl index 2ac647083..d07333dec 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -34,31 +34,18 @@ 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" diff --git a/test/old.jl b/test/old.jl index 86537ac67..d36abbbe3 100644 --- a/test/old.jl +++ b/test/old.jl @@ -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) diff --git a/test/runtests.jl b/test/runtests.jl index 0e3640a3e..aa80ead27 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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')