1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Regexp.escape(RUBY_PLATFORM)

* test/ruby/test_require.rb (TestRequire#test_require_nonascii_path):
  RUBY_PLATFORM should escape as Regexp,
  because RUBY_PLATFORM may contain '.'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2013-04-07 05:11:24 +00:00
parent 1f32d09523
commit 875bba3fc5
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Sun Apr 7 13:56:16 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/ruby/test_require.rb (TestRequire#test_require_nonascii_path):
RUBY_PLATFORM should escape as Regexp,
because RUBY_PLATFORM may contain '.'.
Sun Apr 7 10:44:01 2013 Tanaka Akira <akr@fsij.org>
* include/ruby/defines.h: Simplify the logic to include sys/select.h.

View file

@ -74,7 +74,7 @@ class TestRequire < Test::Unit::TestCase
assert_in_out_err([], <<-INPUT, %w(:ok), [], bug8165)
# coding: #{encoding}
# leave paths for require encoding objects
enc_path = Regexp.new(RUBY_PLATFORM)
enc_path = Regexp.new(Regexp.escape(RUBY_PLATFORM))
$:.replace([IO::NULL] + $:.reject {|path| enc_path !~ path})
p :ok if require '#{require_path}'
p :ng if require '#{require_path}'