diff --git a/README.md b/README.md index ebec0a54117d4..60418ed751c14 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,9 @@ Currently, the `@compat` macro supports the following syntaxes: Compat.DelimitedFiles` are provided on versions older than 0.7, where these are not yet part of the standard library. ([#23931]) +* `using Compat.Base64` is provided on versions older than 0.7, where this library is not + yet a part of the standard library. ([#24361]) + * `using Compat.Dates` is provided on versions older than 0.7, where this library is not yet a part of the standard library. ([#24459]) diff --git a/src/Compat.jl b/src/Compat.jl index 84e58090fbd6e..220409f13845e 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -771,6 +771,13 @@ end end end +# 0.7.0-DEV.2338 +@static if VERSION >= v"0.7.0-DEV.2338" + import Base64 +else + import Base.Base64 +end + @static if VERSION < v"0.7.0-DEV.2377" (::Type{Matrix{T}}){T}(s::UniformScaling, dims::Dims{2}) = setindex!(zeros(T, dims), T(s.λ), diagind(dims...)) (::Type{Matrix{T}}){T}(s::UniformScaling, m::Integer, n::Integer) = Matrix{T}(s, Dims((m, n))) diff --git a/test/runtests.jl b/test/runtests.jl index 62ace1c9707db..1f5e1c47b4ab4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -908,6 +908,12 @@ end @test isa(Array{Float64}(uninitialized, 2, 2), Matrix{Float64}) @test isa(Array{Float64,3}(uninitialized, 2, 2, 2), Array{Float64,3}) +# 0.7.0-DEV.2338 +module Test24361 + using Compat + using Compat.Test + @test String(Compat.Base64.base64decode("SGVsbG8h")) == "Hello!" +end # 0.7 let A = [1] local x = 0