diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_enumerator.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index e3270f3d6a..e1b23792bd 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -452,6 +452,9 @@ class TestEnumerator < Test::Unit::TestCase def test_size assert_equal nil, Enumerator.new{}.size assert_equal 42, Enumerator.new(->{42}){}.size + obj = Object.new + def obj.call; 42; end + assert_equal 42, Enumerator.new(obj){}.size assert_equal 42, Enumerator.new(42){}.size assert_equal 1 << 70, Enumerator.new(1 << 70){}.size assert_equal Float::INFINITY, Enumerator.new(Float::INFINITY){}.size |