Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base64 #418

Merged
merged 7 commits into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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