summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_array.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 6e70dc56fa..c56f06c3b2 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -97,6 +97,17 @@ class TestArray < Test::Unit::TestCase
x = [1,2,3]
x.concat(x)
assert_equal([1,2,3,1,2,3], x)
+
+ x = [1,2,3]
+ x.clear
+ assert_equal([], x)
+
+ x = [1,2,3]
+ y = x.dup
+ x << 4
+ y << 5
+ assert_equal([1,2,3,4], x)
+ assert_equal([1,2,3,5], y)
end
def test_find_all