aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_enumerator.rb
diff options
context:
space:
mode:
authorayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-07 15:51:00 +0000
committerayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-07 15:51:00 +0000
commit0ab21f9572d5d5f76b908aaf3381cde32a64c4c8 (patch)
tree39425ae92c8c974a642e7527df585356c5bbe8e4 /test/ruby/test_enumerator.rb
parent94cd486b511f8a7705f96654fd070835bdecd683 (diff)
downloadruby-0ab21f9572d5d5f76b908aaf3381cde32a64c4c8.tar.gz
* test/ruby/test_enumerator.rb: Add test to shed light upon the bug
which made by r37498. See http://bugs.ruby-lang.org/issues/7298 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_enumerator.rb')
-rw-r--r--test/ruby/test_enumerator.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb
index 896bf3f3f2..6c33e5db5d 100644
--- a/test/ruby/test_enumerator.rb
+++ b/test/ruby/test_enumerator.rb
@@ -67,6 +67,9 @@ class TestEnumerator < Test::Unit::TestCase
assert_match 'Enumerator.new without a block is deprecated', err
assert_equal([1, 2, 3], Enumerator.new { |y| i = 0; loop { y << (i += 1) } }.take(3))
assert_raise(ArgumentError) { Enumerator.new }
+ assert_equal([1, 2, 3], Enumerator.new([1, 2, 3]).take(3))
+ bug7298 = '[ruby-core:49001]'
+ assert_equal([4, 5, 6], Enumerator.new([4, 5, 6]){|y| i = 0; loop { y << (i+=1) } }.take(3))
end
def test_initialize_copy