summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-random/test/random.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2014-04-30 09:50:14 +0900
committerNobuyoshi Nakada <[email protected]>2014-04-30 09:50:14 +0900
commitab67c57f652c7c3a64ec4f4dc73259a14fb1b545 (patch)
treed9535d70ba74920783864fa6372ec471aca5af91 /mrbgems/mruby-random/test/random.rb
parent345f172bba2dc5a6df607dded5c4b95b0e68f9bf (diff)
downloadmruby-ab67c57f652c7c3a64ec4f4dc73259a14fb1b545.tar.gz
mruby-ab67c57f652c7c3a64ec4f4dc73259a14fb1b545.zip
remove trailing spaces
Diffstat (limited to 'mrbgems/mruby-random/test/random.rb')
-rw-r--r--mrbgems/mruby-random/test/random.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/mrbgems/mruby-random/test/random.rb b/mrbgems/mruby-random/test/random.rb
index fa31b782b..1653ae4a6 100644
--- a/mrbgems/mruby-random/test/random.rb
+++ b/mrbgems/mruby-random/test/random.rb
@@ -31,32 +31,32 @@ assert("float") do
rand.class == Float
end
-assert("Array#shuffle") do
+assert("Array#shuffle") do
ary = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shuffled = ary.shuffle
-
+
ary == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and shuffled != ary and 10.times { |x| ary.include? x }
end
assert('Array#shuffle!') do
ary = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
ary.shuffle!
-
+
ary != [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and 10.times { |x| ary.include? x }
end
-assert("Array#shuffle(random)") do
+assert("Array#shuffle(random)") do
assert_raise(TypeError) do
# this will cause an exception due to the wrong argument
[1, 2].shuffle "Not a Random instance"
end
-
+
# verify that the same seed causes the same results
ary1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shuffle1 = ary1.shuffle Random.new 345
ary2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shuffle2 = ary2.shuffle Random.new 345
-
+
ary1 != shuffle1 and 10.times { |x| shuffle1.include? x } and shuffle1 == shuffle2
end
@@ -65,12 +65,12 @@ assert('Array#shuffle!(random)') do
# this will cause an exception due to the wrong argument
[1, 2].shuffle! "Not a Random instance"
end
-
+
# verify that the same seed causes the same results
ary1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
ary1.shuffle! Random.new 345
ary2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
ary2.shuffle! Random.new 345
-
+
ary1 != [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and 10.times { |x| ary1.include? x } and ary1 == ary2
end