summaryrefslogtreecommitdiff
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index b8df561109..fcc493951f 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -1297,6 +1297,11 @@ class TestArray < Test::Unit::TestCase
"edcba".each_char.to_a.permutation(5).sort)
assert_equal(@cls[].permutation(0).to_a, @cls[[]])
+ a = @cls[1, 2, 3, 4]
+ b = @cls[]
+ a.permutation {|x| b << x; a.replace(@cls[9, 8, 7, 6]) }
+ assert_equal(@cls[9, 8, 7, 6], a)
+ assert_equal(@cls[1, 2, 3, 4].permutation.to_a, b)
end
def test_take