diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-19 08:19:18 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-19 08:19:18 +0000 |
| commit | 5e19af98d99437e6add2968eb50c76fafbdccf47 (patch) | |
| tree | eb9cf108a8ce55b7663b607dd36e8a4eb472bc38 /sample | |
| parent | 0b6bb3b193a132941bff80421cdf59c00ada0460 (diff) | |
| download | ruby-5e19af98d99437e6add2968eb50c76fafbdccf47.tar.gz ruby-5e19af98d99437e6add2968eb50c76fafbdccf47.tar.xz ruby-5e19af98d99437e6add2968eb50c76fafbdccf47.zip | |
* sample/test.rb (proc_return3): return within non lambda block
should terminate surrounding method. [ruby-dev:28741]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
| -rw-r--r-- | sample/test.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sample/test.rb b/sample/test.rb index e6a500c4b..4ff909ef1 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -1099,13 +1099,21 @@ def proc_yield() yield end def proc_return1 - proc_call{return 42}+1 + lambda{return 42}.call+1 end test_ok(proc_return1() == 43) def proc_return2 + ->{return 42}.call+1 +end +test_ok(proc_return2() == 43) +def proc_return3 + proc_call{return 42}+1 +end +test_ok(proc_return3() == 42) +def proc_return4 proc_yield{return 42}+1 end -test_ok(proc_return2() == 42) +test_ok(proc_return4() == 42) def ljump_test(state, proc, *args) x = state |
