mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Tested LocalJumpErrors caused by break in a proc
This commit is contained in:
@@ -66,6 +66,10 @@ end
|
||||
|
||||
assert('Kernel#proc') do
|
||||
assert_true !proc{|a|}.lambda?
|
||||
|
||||
assert_raise LocalJumpError do
|
||||
proc{ break }.call
|
||||
end
|
||||
end
|
||||
|
||||
assert('mrb_proc_new_cfunc_with_env') do
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user