aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_eval.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_eval.rb')
-rw-r--r--test/ruby/test_eval.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb
index fc08d61ef5..a2029bb9b5 100644
--- a/test/ruby/test_eval.rb
+++ b/test/ruby/test_eval.rb
@@ -525,4 +525,14 @@ class TestEval < Test::Unit::TestCase
b.eval('yield')
}, '[Bug #10368]'
end
+
+ def test_return_in_eval_proc
+ x = proc {eval("return :ng")}
+ assert_raise(LocalJumpError) {x.call}
+ end
+
+ def test_return_in_eval_lambda
+ x = lambda {eval("return :ok")}
+ assert_equal(:ok, x.call)
+ end
end