Skip to content

Commit

Permalink
Base64 (#418)
Browse files Browse the repository at this point in the history
Compat.Base64
  • Loading branch information
Nosferican authored and fredrikekre committed Nov 30, 2017
1 parent 5ab47d1 commit 5ada727
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])

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

0 comments on commit 5ada727

Please sign in to comment.