summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-18 08:30:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-18 08:30:24 +0000
commit3367daf716bda6e73f3418dd601bd1713d557c07 (patch)
tree2d78598b19862c92493aba8d3a4f375461dc5010 /test
parent32fd8649d8ad091542a26293d948b3aebc385267 (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.rb6
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