mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 09:04:05 +02:00
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@23191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
31c1883a54
commit
bded3bb726
3 changed files with 19 additions and 1 deletions
|
@ -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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue