diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 10:29:38 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 10:29:38 +0000 |
commit | e86c91414055573dc914c83ab0725f43926f478f (patch) | |
tree | 4a693c412f1741fac43becf03e372d7d863711b4 /test/ruby | |
parent | e9ebea251d5d6c20f15e06cd232dab2522c4d16f (diff) |
merge revision(s) 15541, 15545, 15558:
* parse.y (yycompile): clear ruby_eval_tree_begin too before parse.
* parse.y (yycompile): clear ruby_eval_tree_begin if parse failed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_beginendblock.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb index b56b596a65..f8c9c846bd 100644 --- a/test/ruby/test_beginendblock.rb +++ b/test/ruby/test_beginendblock.rb @@ -54,4 +54,16 @@ EOW assert_equal(expected, File.read(erroutpath)) # expecting Tempfile to unlink launcher and errout file. end + + def test_begin_and_eval + $test_begin_and_eval = :ok + begin + eval("BEGIN{$test_begin_and_eval = :ng}\n_/a:a") + rescue SyntaxError + x1 = x2 = $test_begin_and_eval + eval("x2 = $test_begin_and_eval") + end + assert_equal(:ok, x1) + assert_equal(:ok, x2) + end end |