Skip to content

Commit

Permalink
New rand(UnitRange) method in Base requires adjustment of some test v…
Browse files Browse the repository at this point in the history
…alues
  • Loading branch information
andreasnoack committed Aug 19, 2017
1 parent a08cc8b commit 92ffb68
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions test/sampling.jl
Expand Up @@ -76,15 +76,24 @@ check_sample_wrep(a, (3, 12), 0; ordered=true)

test_rng_use(sample, 1:10, 10)

#### sampling pairs
@testset "sampling pairs" begin

srand(1);
srand(1)

if VERSION < v"0.7.0-DEV.1325" # new faster rand(MersenneTwister, UnitRange)
@test samplepair(2) === (1, 2)
@test samplepair(10) === (10, 6)

@test samplepair(2) === (1, 2)
@test samplepair(10) === (10, 6)
@test samplepair([3, 4, 2, 6, 8]) === (6, 2)
@test samplepair([1, 2]) === (1, 2)
else
@test samplepair(2) === (1, 2)
@test samplepair(10) === (8, 2)

@test samplepair([3, 4, 2, 6, 8]) === (6, 2)
@test samplepair([1, 2]) === (1, 2)
@test samplepair([3, 4, 2, 6, 8]) === (2, 6)
@test samplepair([1, 2]) === (1, 2)
end
end

test_rng_use(samplepair, 1000)

Expand Down

0 comments on commit 92ffb68

Please sign in to comment.