summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-10 22:57:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-10 22:57:38 +0000
commitef42d998bda17aa3843b7fe9ef3640df6dccf649 (patch)
tree122644a531c4cc8bc627a234e44811ccac84edd7 /test
parent9b421423669a6f4b639a372d019f2add60a260b0 (diff)
* 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/branches/ruby_1_8@8964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_iterator.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb
index f3c2201..5c2ef18 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