Skip to content

Commit

Permalink
Mark Compat.UUIDs from #490 for deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 45ab207 commit bc73673
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 31 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.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]).
Expand Down
14 changes: 1 addition & 13 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import Distributed
import Pkg
import InteractiveUtils
import LibGit2
import UUIDs


include("compatmacro.jl")
Expand All @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
15 changes: 0 additions & 15 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc73673

Please sign in to comment.