* test/ruby/test_system.rb (TestSystem::valid_syntax): apply

ASCII-8BIT encoding explicitly.

* re.c (rb_reg_prepare_re): add encoding name in the message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-12-21 05:03:14 +00:00
parent 59dca19910
commit 668bd7d992
3 changed files with 9 additions and 1 deletions

View file

@ -4,6 +4,7 @@ require 'tmpdir'
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"
}