summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-01 10:24:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-01 10:24:12 +0000
commit01eb117b01576e5b8386af5b6b425655f314888c (patch)
tree02458d345d69d2f4adf0e8be339990e3d344e219 /test
parentaf4ceeff105003cbb124c420898121742ed66bd7 (diff)
io.c: recurse for the argument
* io.c (rb_io_puts): recurse for the argument itself, not converted array elements. [ruby-core:42444] [Bug #5986] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index d0924844b1..d509a9bfe2 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2583,5 +2583,17 @@ End
end
end
end
+
+ def test_puts_recursive_ary
+ bug5986 = '[ruby-core:42444]'
+ c = Class.new {
+ def to_ary
+ [self]
+ end
+ }
+ s = StringIO.new
+ s.puts(c.new)
+ assert_equal("[...]\n", s.string, bug5986)
+ end
end