From fb9034e757da5ecdb79bb552233696779b54b9b7 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 10 Oct 2012 18:38:01 +0000 Subject: [PATCH] * bootstraptest/test_block.rb: add tests for block with super. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ bootstraptest/test_block.rb | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/ChangeLog b/ChangeLog index c630106891..2e76e717a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Oct 11 03:37:08 2012 Koichi Sasada + + * bootstraptest/test_block.rb: add tests for block with super. + Thu Oct 11 02:54:07 2012 Koichi Sasada * vm_dump.c: fix debug prints to catch up recent changes diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb index ea6768cc25..6a2ccfc6da 100644 --- a/bootstraptest/test_block.rb +++ b/bootstraptest/test_block.rb @@ -565,3 +565,35 @@ assert_normal_exit %q{ t.test_for_bug }, '[ruby-core:14395]' +assert_equal 'true', %q{ + class C0 + def foo + block_given? + end + end + + class C1 < C0 + def foo + super + end + end + + C1.new.foo{} +} + +assert_equal 'true', %q{ + class C0 + def foo + block_given? + end + end + + class C1 < C0 + def foo + super() + end + end + + C1.new.foo{} +} +