summaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-16 20:54:58 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-16 20:54:58 +0000
commit7201f9b100fc682d2485ca952b3a1e99787781c6 (patch)
treebd8e099d091caafe96306266420c926016b04c93 /bootstraptest
parent4731639427cbddfed8972f4ffc120e9dac2fdc41 (diff)
downloadruby-7201f9b100fc682d2485ca952b3a1e99787781c6.tar.gz
ruby-7201f9b100fc682d2485ca952b3a1e99787781c6.tar.xz
ruby-7201f9b100fc682d2485ca952b3a1e99787781c6.zip
* compile.c: fix to add "ensure" codes across "while" clause
before "return" expression. [ruby-dev:37967] * bootstraptest/test_flow.rb: add a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_flow.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb
index 9964dfb2e..46ca1a0c6 100644
--- a/bootstraptest/test_flow.rb
+++ b/bootstraptest/test_flow.rb
@@ -200,7 +200,9 @@ assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
end; $a << 8
; $a << 9
; rescue Exception; $a << 99; end; $a}
-assert_equal %q{[1, 2, 3, 5, 99]}, %q{$a = []; begin; ; $a << 1
+assert_equal %q{[1, 2, 3, 5, 99]}, %q{
+$a = [];
+begin; ; $a << 1
while true; $a << 2
begin; $a << 3
break; $a << 4
@@ -488,4 +490,15 @@ assert_equal %q{[:ok, :ok2, :last]}, %q{
a << :last
end
a
- }
+}
+assert_equal %Q{ENSURE\n}, %q{
+ def test
+ while true
+ return
+ end
+ ensure
+ puts("ENSURE")
+ end
+ test
+}, '[ruby-dev:37967]'
+