Skip to content

Commit

Permalink
fix overflow error in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed May 1, 2020
1 parent 5facdd1 commit 60c3edd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/Random/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ end

@testset "fast(a:b)" begin
for bounds = (rand(Int, 2), rand(-1000:1000, 2))
a, b = minmax(bounds...)
a, b = minmax((bounds .>> 2)...) # right-shift to avoid overflow in length(a:1:b)
a == b && continue
@test rand(Random.fast(a:b)) a:b
@test rand(Random.fast(a:1:b)) a:b
Expand Down

0 comments on commit 60c3edd

Please sign in to comment.