summaryrefslogtreecommitdiff
path: root/test/ruby/test_beginendblock.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_beginendblock.rb')
-rw-r--r--test/ruby/test_beginendblock.rb12
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