diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-17 06:22:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-17 06:22:58 +0000 |
commit | a6db50e02b3a93eb9b475d65cb0e9d0e96a46e1c (patch) | |
tree | dbe810f986a5dfd4b0ce5335b3cdb71f5edbbfe9 /test/ruby/test_system.rb | |
parent | 53ecede90b163d37c3e2b5b4f845be23eabb2caa (diff) | |
download | ruby-a6db50e02b3a93eb9b475d65cb0e9d0e96a46e1c.tar.gz |
* sample/test.rb (valid_syntax?): should not capture BOM.
* test/ruby/test_system.rb (TestSystem#valid_syntax?): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_system.rb')
-rw-r--r-- | test/ruby/test_system.rb | 2 |
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") |