diff options
Diffstat (limited to 'test')
-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 |