From 660d30ea1046f5d6909cba1222e573fe8b6a1f00 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Tue, 8 Oct 2019 17:34:01 +0200 Subject: [PATCH] Mark `Compat.UUIDs` from #490 for deprecation --- README.md | 3 --- src/Compat.jl | 14 +------------- test/old.jl | 15 +++++++++++++++ test/runtests.jl | 15 --------------- 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index c1293b9cd..4901c9084 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,6 @@ Currently, the `@compat` macro supports the following syntaxes: ## Module Aliases -* `using Compat.UUIDs` is provided on versions older than 0.7, where this library is - not yet part of the standard library ([#25819]). - ## New functions, macros, and methods * `mod` now accepts a unit range as the second argument ([#32628]). diff --git a/src/Compat.jl b/src/Compat.jl index bcc197ce3..1bdf5ffba 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -50,6 +50,7 @@ import Distributed import Pkg import InteractiveUtils import LibGit2 +import UUIDs include("compatmacro.jl") @@ -75,19 +76,6 @@ end end end -if VERSION >= v"0.7.0-DEV.3666" - import UUIDs -else - @eval module UUIDs - if VERSION < v"0.7.0-DEV.3406" - import Base.Random: uuid1, uuid4, uuid_version, UUID - else - import Random: uuid1, uuid4, uuid_version, UUID - end - export uuid1, uuid4, uuid_version, UUID - end -end - # https://github.com/JuliaLang/julia/pull/26670 @static if VERSION < v"0.7.0-DEV.4062" trunc(x; digits = 0, base = 10) = Base.trunc(x, digits, base) diff --git a/test/old.jl b/test/old.jl index 9c7554563..f2efccfe5 100644 --- a/test/old.jl +++ b/test/old.jl @@ -217,6 +217,21 @@ module TestLibGit2 @test isdefined(@__MODULE__, :GitRepo) end +# 0.7.0-DEV.3666 +module TestUUIDs + using Compat + using Compat.UUIDs + using Compat.Test + @test isdefined(@__MODULE__, :uuid1) + @test isdefined(@__MODULE__, :uuid4) + @test isdefined(@__MODULE__, :uuid_version) + + @test uuid_version(uuid1()) == 1 + @test uuid_version(uuid4()) == 4 + @test uuid1() isa UUID + @test uuid4() isa UUID +end + # tests of removed functionality (i.e. justs tests Base) diff --git a/test/runtests.jl b/test/runtests.jl index 41ef6a78f..b616ce249 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -82,21 +82,6 @@ end @test codeunit("foo") == codeunit(SubString("fooαβγ",1,3)) == UInt8 -# 0.7.0-DEV.3666 -module TestUUIDs - using Compat - using Compat.UUIDs - using Compat.Test - @test isdefined(@__MODULE__, :uuid1) - @test isdefined(@__MODULE__, :uuid4) - @test isdefined(@__MODULE__, :uuid_version) - - @test uuid_version(uuid1()) == 1 - @test uuid_version(uuid4()) == 4 - @test uuid1() isa UUID - @test uuid4() isa UUID -end - # 0.7.0-DEV.4804 @test Compat.trunc(pi) == 3.0 @test Compat.floor(pi) == 3.0