From 4e095bff4d9cbf1835c3d4278028242eca2fff16 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 1 Aug 2003 02:52:21 +0000 Subject: * eval.c (BEGIN_CALLARGS): should not always reset ruby_iter, need to restore previous value. [ruby-talk:77577] * array.c (rb_ary_fill): array length may be changed during the block execution. [ruby-talk:77579] * array.c (rb_ary_zip): ditto. * array.c (rb_ary_fill): ditto. * hash.c (env_reject_bang): length may be changed during the block execution. * hash.c (env_clear): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sample') diff --git a/sample/test.rb b/sample/test.rb index e281b679b..1fb1c24cf 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -1064,6 +1064,20 @@ marity_test(:p) lambda(&method(:test_ok)).call(true) lambda(&get_block{|a,n| test_ok(a,n)}).call(true, 2) +class ITER_TEST1 + def a + block_given? + end +end + +class ITER_TEST2 < ITER_TEST1 + def a + test_ok(super) + super + end +end +test_ok(ITER_TEST2.new.a {}) + test_check "float" test_ok(2.6.floor == 2) test_ok((-2.6).floor == -3) -- cgit