diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-18 08:30:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-18 08:30:24 +0000 |
commit | 3367daf716bda6e73f3418dd601bd1713d557c07 (patch) | |
tree | 2d78598b19862c92493aba8d3a4f375461dc5010 /test | |
parent | 32fd8649d8ad091542a26293d948b3aebc385267 (diff) |
Tests of Enumerator::Yielder#yield with multiple arguments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_enumerator.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index 22ec62e252..a24ff00d96 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -476,6 +476,12 @@ class TestEnumerator < Test::Unit::TestCase assert_equal([1], y.yield(1)) assert_equal([1, 2], y.yield(2)) assert_equal([1, 2, 3], y.yield(3)) + assert_equal([1, 2, 3, 4], y.yield(4, 5)) + + a = [] + y = Enumerator::Yielder.new {|*x| a.concat(x) } + assert_equal([1], y.yield(1)) + assert_equal([1, 2, 3], y.yield(2, 3)) assert_raise(LocalJumpError) { Enumerator::Yielder.new } end |