summaryrefslogtreecommitdiffstats
path: root/bootstraptest/test_eval.rb
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
commitd91b18f561b4fdf5afe73705a013d3e4ca043ec3 (patch)
treeeb38d3722b555b480f00303979429b20ef2f2a41 /bootstraptest/test_eval.rb
parent5aaabd1f15cdc026ce2c7fdc704351238c6ea7ef (diff)
downloadruby-d91b18f561b4fdf5afe73705a013d3e4ca043ec3.tar.gz
ruby-d91b18f561b4fdf5afe73705a013d3e4ca043ec3.tar.xz
ruby-d91b18f561b4fdf5afe73705a013d3e4ca043ec3.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@14339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 2f5e91207..b2a576246 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