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

Compat.Random #460

Merged
merged 1 commit into from
Jan 18, 2018
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ Currently, the `@compat` macro supports the following syntaxes:
* `using Compat.SparseArrays` is provided on versions older than 0.7, where this library is
not yet part of the standard library ([#25249]).

* `using Compat.Random` is provided on versions older than 0.7, where this library is
not yet part of the standard library ([#24874]).

## New functions, macros, and methods

* `@views` takes an expression and converts all slices to views ([#20164]), while
Expand Down Expand Up @@ -438,6 +441,7 @@ includes this fix. Find the minimum version from there.
[#24714]: https://github.com/JuliaLang/julia/issues/24714
[#24785]: https://github.com/JuliaLang/julia/issues/24785
[#24808]: https://github.com/JuliaLang/julia/issues/24808
[#24874]: https://github.com/JuliaLang/julia/issues/24874
[#25012]: https://github.com/JuliaLang/julia/issues/25012
[#25021]: https://github.com/JuliaLang/julia/issues/25021
[#25056]: https://github.com/JuliaLang/julia/issues/25056
Expand Down
6 changes: 6 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,12 @@ else
import SparseArrays
end

if VERSION < v"0.7.0-DEV.3406"
const Random = Base.Random
else
import Random
end

if VERSION < v"0.7.0-DEV.2609"
@eval module SuiteSparse
if Base.USE_GPL_LIBS
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,10 @@ let A = [0, 0, 0], B = [1, 2, 3]
@test unsafe_copyto!(A, 2, B, 1, 1) === A == [0, 1, 0]
end

# 0.7.0-DEV.3406
using Compat.Random
@test rand(MersenneTwister(1234)) == 0.5908446386657102

# 0.7
@test contains("Hello, World!", r"World")

Expand Down