aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_rand.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_rand.rb')
-rw-r--r--test/ruby/test_rand.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb
index 0b601628f6..fe88305788 100644
--- a/test/ruby/test_rand.rb
+++ b/test/ruby/test_rand.rb
@@ -170,8 +170,9 @@ class TestRand < Test::Unit::TestCase
def test_shuffle
srand(0)
- assert_equal([1,4,2,5,3], [1,2,3,4,5].shuffle)
- assert_equal([1,4,2,5,3], [1,2,3,4,5].shuffle(random: Random.new(0)))
+ result = [*1..5].shuffle
+ assert_equal([*1..5], result.sort)
+ assert_equal(result, [*1..5].shuffle(random: Random.new(0)))
end
def test_big_seed