mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 09:04:05 +02:00
* array.c (recursive_join): raise ArgumentError for joining
recursive array. * array.c (ary_join_1): ditto. * test/ruby/test_array.rb (TestArray#test_join2): test updated for recursive join. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4d70a43e3d
commit
ae487eda6e
3 changed files with 14 additions and 5 deletions
|
@ -1490,12 +1490,12 @@ class TestArray < Test::Unit::TestCase
|
|||
def test_join2
|
||||
a = []
|
||||
a << a
|
||||
assert_equal("[...]", a.join)
|
||||
assert_raise(ArgumentError){a.join}
|
||||
|
||||
def (a = Object.new).to_a
|
||||
[self]
|
||||
end
|
||||
assert_equal("[...]", [a].join, '[ruby-core:24150]')
|
||||
assert_raise(ArgumentError, '[ruby-core:24150]'){[a].join}
|
||||
assert_equal("12345", [1,[2,[3,4],5]].join)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue