aboutsummaryrefslogtreecommitdiffstats
path: root/sample/test.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-21 15:57:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-21 15:57:26 +0000
commit389278af977066c5c8b077432920db6df89fcd6a (patch)
treeb9cd5c093c97e330fa6abde26ce7f169aae132a8 /sample/test.rb
parentfede8b213b8b06537c160f911698c12793920d24 (diff)
downloadruby-389278af977066c5c8b077432920db6df89fcd6a.tar.gz
* sample/test.rb (valid_syntax): force_encoding input script.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/test.rb')
-rw-r--r--sample/test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/sample/test.rb b/sample/test.rb
index a9940039cd..52898d582c 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1866,6 +1866,7 @@ end
def valid_syntax?(code, fname)
p fname
+ code.force_encoding("ascii-8bit")
code = code.sub(/\A(?:\s*\#.*$)*(\n)?/n) {
"#$&#{"\n" if $1 && !$2}BEGIN{return true}\n"
}