diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-07 07:40:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-07 07:40:11 +0000 |
commit | 94ee3e7e0207eedac81b30444f72d5b51a7c2230 (patch) | |
tree | 1bc72beb3a030b837e5cab4819d82b438d63bf53 /test/ruby | |
parent | 2f164472392ada9858971da5900b8895e70fc6be (diff) |
* array.c (rb_ary_flatten_bang): returns nil if nothing changed.
a patch from Marc-Andre Lafortune in [ruby-core:23382].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_array.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index a20c6b23cd..7b0039310a 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -736,11 +736,14 @@ class TestArray < Test::Unit::TestCase a5 = @cls[ a1, @cls[], a3 ] assert_equal(@cls[1, 2, 3, 4, 5, 6], a5.flatten!) + assert_nil(a5.flatten!(0), '[ruby-core:23382]') assert_equal(@cls[1, 2, 3, 4, 5, 6], a5) assert_equal(@cls[], @cls[].flatten) assert_equal(@cls[], @cls[@cls[@cls[@cls[],@cls[]],@cls[@cls[]],@cls[]],@cls[@cls[@cls[]]]].flatten) + + assert_nil(@cls[].flatten!(0), '[ruby-core:23382]') end def test_flatten_with_callcc |