diff options
Diffstat (limited to 'bootstraptest/test_flow.rb')
| -rw-r--r-- | bootstraptest/test_flow.rb | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb index 0390062a24..7a95def1e6 100644 --- a/bootstraptest/test_flow.rb +++ b/bootstraptest/test_flow.rb @@ -363,7 +363,7 @@ assert_equal %q{[1, 2, 3, 5, 2, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1 ; $a << 8 ; rescue Exception; $a << 99; end; $a} assert_equal %q{[1, 2, 6, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1 - o = "test"; $a << 2 + o = "test".dup; $a << 2 def o.test(a); $a << 3 return a; $a << 4 ensure; $a << 5 @@ -376,7 +376,7 @@ assert_equal %q{[1, 4, 7, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1 ; $a << 3 end; $a << 4 def m2; $a << 5 - m1(:a, :b, (return 1; :c)); $a << 6 + m1(:a, :b, (return 1 if true; :c)); $a << 6 end; $a << 7 m2; $a << 8 ; $a << 9 @@ -399,7 +399,7 @@ assert_equal %q{[1, 3, 11, 4, 5, 6, 7, 12, 13]}, %q{$a = []; begin; ; $a << 1 m2(begin; $a << 5 2; $a << 6 ensure; $a << 7 - return 3; $a << 8 + return 3 if true; $a << 8 end); $a << 9 4; $a << 10 end; $a << 11 @@ -534,11 +534,11 @@ assert_equal %Q{ENSURE\n}, %q{ ['[ruby-core:39125]', %q{ class Bug5234 include Enumerable - def each + def each(&block) begin yield :foo ensure - proc + proc(&block) end end end @@ -547,11 +547,11 @@ assert_equal %Q{ENSURE\n}, %q{ ['[ruby-dev:45656]', %q{ class Bug6460 include Enumerable - def each + def each(&block) begin yield :foo ensure - 1.times { Proc.new } + 1.times { Proc.new(&block) } end end end @@ -589,3 +589,13 @@ assert_equal "foo", %q{ end Bug6460.new.m1 }, '[ruby-dev:46372]' + +assert_equal "foo", %q{ + obj = "foo" + if obj || any1 + any2 = any2 + else + raise obj.inspect + end + obj +}, '[ruby-core:87830]' |
