aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest/test_eval.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/test_eval.rb')
-rw-r--r--bootstraptest/test_eval.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
index 2f5e912074..b2a5762460 100644
--- a/bootstraptest/test_eval.rb
+++ b/bootstraptest/test_eval.rb
@@ -189,7 +189,12 @@ assert_equal %q{[10, main]}, %q{
$ans
}
-assert_match /Illegal break/, %q{
- STDERR.reopen(STDOUT)
- eval "0 rescue break"
-}, '[ruby-dev:31372]'
+%w[break next redo].each do |keyword|
+ assert_match %r"Can't escape from eval with #{keyword}\z", %{
+ begin
+ eval "0 rescue #{keyword}"
+ rescue SyntaxError => e
+ e.message
+ end
+ }, '[ruby-dev:31372]'
+end