* 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:
matz 2009-07-17 02:04:37 +00:00
parent 4d70a43e3d
commit ae487eda6e
3 changed files with 14 additions and 5 deletions

View file

@ -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