diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-09-02 22:19:15 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-09-02 22:19:15 +0900 |
| commit | 476af3c64726fed823e4a1fdc316f0780f340246 (patch) | |
| tree | 61be82650f95b6b98482371611d029bbc70b9ed9 /test | |
| parent | ab99e2c293167935033016750c010047a2aba76a (diff) | |
| parent | 35deaae7768b1f5404cf00c1ca85d9d770062413 (diff) | |
| download | mruby-476af3c64726fed823e4a1fdc316f0780f340246.tar.gz mruby-476af3c64726fed823e4a1fdc316f0780f340246.zip | |
Merge pull request #3802 from christopheraue/proc_break_tests
Tested local jump errors caused by break in a proc
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/proc.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/t/proc.rb b/test/t/proc.rb index ef4566e66..42ac3b941 100644 --- a/test/t/proc.rb +++ b/test/t/proc.rb @@ -11,6 +11,10 @@ assert('Proc.new', '15.2.17.3.1') do end assert_equal (Proc.new {}).class, Proc + + assert_raise LocalJumpError do + Proc.new{ break }.call + end end assert('Proc#[]', '15.2.17.4.1') do @@ -164,3 +168,13 @@ assert('&obj call to_proc if defined') do assert_raise(TypeError){ mock(&(Object.new)) } end + +assert('Creation of a proc through the block of a method') do + def m(&b) b end + + assert_equal m{}.class, Proc + + assert_raise LocalJumpError do + m{ break }.call + end +end |
