aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-24 00:48:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-24 00:48:15 +0000
commit483c7290f2509a9d5a3e193a66689971394d4de8 (patch)
treeedb5f34e8752a4b5e7e69ad5b4f15dd9643fcc9b /test
parent5c3be90ae09f03f412cde51dc500da51827aafe7 (diff)
downloadruby-483c7290f2509a9d5a3e193a66689971394d4de8.tar.gz
enumerator.c: fix inspect with the last empty hash
[ruby-core:90685] [Bug #15455] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_enumerator.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb
index afd356105d..efcfef580f 100644
--- a/test/ruby/test_enumerator.rb
+++ b/test/ruby/test_enumerator.rb
@@ -407,6 +407,12 @@ class TestEnumerator < Test::Unit::TestCase
e = (0..10).each_cons(2)
assert_equal("#<Enumerator: 0..10:each_cons(2)>", e.inspect)
+ e = (0..10).each_with_object({})
+ assert_equal("#<Enumerator: 0..10:each_with_object({})>", e.inspect)
+
+ e = (0..10).each_with_object(a: 1)
+ assert_equal("#<Enumerator: 0..10:each_with_object(a: 1)>", e.inspect)
+
e = Enumerator.new {|y| y.yield; 10 }
assert_match(/\A#<Enumerator: .*:each>/, e.inspect)