summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_require.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index bca6a9754c..2e7b37d138 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -59,6 +59,27 @@ class TestRequire < Test::Unit::TestCase
end
end
+ def test_require_nonascii_path
+ bug8165 = '[ruby-core:53733] [Bug #8165]'
+ Dir.mktmpdir {|tmp|
+ encoding = /mswin|mingw/ =~ RUBY_PLATFORM ? 'filesystem' : 'UTF-8'
+ dir = "\u3042" * 5
+ begin
+ require_path = File.join(tmp, dir, 'foo.rb').encode(encoding)
+ rescue
+ skip "cannot convert path encoding to #{encoding}"
+ end
+ Dir.mkdir(File.dirname(require_path))
+ open(require_path, "wb") {}
+ assert_in_out_err([], <<-INPUT, %w(:ok), [], bug8165)
+ # coding: #{encoding}
+ $:.replace([IO::NULL] + $:.reject {|path| path !~ /\.ext/})
+ p :ok if require '#{require_path}'
+ p :ng if require '#{require_path}'
+ INPUT
+ }
+ end
+
def test_require_path_home_1
env_rubypath, env_home = ENV["RUBYPATH"], ENV["HOME"]
pathname_too_long = /pathname too long \(ignored\).*\(LoadError\)/m