summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-19 16:10:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-19 16:10:54 +0000
commita927483326e54e6a4e9387009af0b57f38636497 (patch)
treeeb38d3722b555b480f00303979429b20ef2f2a41 /bootstraptest
parent5e8e08d74e9ed8f6805e0f86c643900770b1564d (diff)
* compile.c (iseq_compile_each): should handle upper level eval iseq
from break/next, and COMPILE_ERROR() breaks only one block. [ruby-dev:31372] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-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