diff options
Diffstat (limited to 'test/ruby/test_system.rb')
-rw-r--r-- | test/ruby/test_system.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb index ec8aca74cb..4aae0d54f1 100644 --- a/test/ruby/test_system.rb +++ b/test/ruby/test_system.rb @@ -6,9 +6,9 @@ class TestSystem < Test::Unit::TestCase def valid_syntax?(code, fname) code.force_encoding("ascii-8bit") code = code.sub(/\A(?:\s*\#.*$)*(\n)?/n) { - "#$&#{"\n" if $1 && !$2}BEGIN{return true}\n" + "#$&#{"\n" if $1 && !$2}BEGIN{throw tag, :ok}\n" } - eval(code, nil, fname, 0) + catch {|tag| eval(code, binding, fname, 0)} end def test_system |