mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_beginendblock.rb (test_begin_and_eval): add test for
http://sourceforge.net/mailarchive/message.php?msg_name=47B2FD16.6040408%40vvvvvv.sakura.ne.jp git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
320e6b0837
commit
929223e720
1 changed files with 12 additions and 0 deletions
|
@ -83,4 +83,16 @@ EOW
|
|||
assert_nil $?.exitstatus
|
||||
assert_equal Signal.list["INT"], $?.termsig
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue