diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-04-15 11:47:54 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-04-15 11:47:54 +0000 |
commit | 4ca367fed442858b6a22f2009318a0fab35f4646 (patch) | |
tree | 75f3598c1938f48b98000c14dc87cdc03674a21b /test | |
parent | 1a60f3b6f18ee2d6381ea26dbab8784cd690046e (diff) | |
download | ruby-4ca367fed442858b6a22f2009318a0fab35f4646.tar.gz ruby-4ca367fed442858b6a22f2009318a0fab35f4646.tar.xz ruby-4ca367fed442858b6a22f2009318a0fab35f4646.zip |
* array.c (rb_ary_flatten): flatten(0) works as Array#dup.
[ruby-core:23168]
* test/ruby/test_array.rb: add a test for above.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_array.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 92c309241..9b3dfdf45 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -719,6 +719,11 @@ class TestArray < Test::Unit::TestCase a7 = a6.flatten assert_equal(true, a7.tainted?) assert_equal(true, a7.untrusted?) + + a8 = @cls[[1, 2], 3] + a9 = a8.flatten(0) + assert_equal(a8, a9) + assert_not_same(a8, a9) end def test_flatten! |