summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-20 01:26:39 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-20 01:26:39 +0000
commit746200ae46d670f0bd4b9939425c052f0fdf44bd (patch)
tree6dac95166d4420a8e8313823b223fde9409b5173 /test/ruby
parent2a3bfca5f4a5e13ec96aa7eb717d261974843eb7 (diff)
downloadruby-746200ae46d670f0bd4b9939425c052f0fdf44bd.tar.gz
ruby-746200ae46d670f0bd4b9939425c052f0fdf44bd.tar.xz
ruby-746200ae46d670f0bd4b9939425c052f0fdf44bd.zip
* test/ruby/test_array.rb (test_misc): added some tests
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-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 5d85927da..fc55b8617 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_beg_end