summaryrefslogtreecommitdiff
path: root/test/ruby/test_system.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_system.rb')
-rw-r--r--test/ruby/test_system.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 2143fcad71..be441c95fe 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -5,7 +5,7 @@ require_relative 'envutil'
class TestSystem < Test::Unit::TestCase
def valid_syntax?(code, fname)
code = code.dup.force_encoding("ascii-8bit")
- code.sub!(/\A(\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) {
+ code.sub!(/\A(?:\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) {
"#$&#{"\n" if $1 && !$2}BEGIN{throw tag, :ok}\n"
}
code.force_encoding("us-ascii")