From 90ac1484f1408ec9343ebed8dcc2f2b33048d826 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 10 Aug 2005 22:57:38 +0000 Subject: [PATCH] * test/ruby/test_iterator.rb (test_block_passing): yield in method argument behaves differently. [ruby-dev:26274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_iterator.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb index cf9a6fdb34..738e974461 100644 --- a/test/ruby/test_iterator.rb +++ b/test/ruby/test_iterator.rb @@ -189,6 +189,14 @@ class TestIterator < Test::Unit::TestCase assert(!m2()) end + def m3(var, &block) + m(yield(var), &block) + end + + def test_block_passing + assert_equal(100, m3(10) {|x|x*x}) + end + class C include Enumerable def initialize