diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-16 17:34:44 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-16 17:34:44 +0000 |
commit | 2368dbdfa3c438b614a4727bde7cacac2d0a87a9 (patch) | |
tree | a3580abe631e47b8fc161eb5085587023cf19bfa /test | |
parent | 3ca42c0435512e44f4662152afa62100be968c8f (diff) |
merge revision(s) 58745,58780,59040,60743: [Backport #13863]
rb_w32_ugetcwd: UTF-8 version getcwd
* dir.c (rb_dir_getwd): convert from UTF-8.
* win32/win32.c (w32_getcwd): codepage aware getcwd using
GetCurrentDirectoryW.
potential memory leak
* dir.c (rb_dir_getwd): get rid of potential memory leak.
* util.c (ruby_getcwd): ditto.
file.c: realpath in OS path encoding
* dir.c (rb_dir_getwd_ospath): return cwd path in the OS path
encoding.
* file.c (rb_realpath_internal): work in the OS path encoding
load.c: cwd encoding
* load.c (rb_get_expanded_load_path): save cwd cache in OS path
encoding, to get rid of unnecessary conversion and infinite
loading when it needs encoding conversion.
[ruby-dev:50221] [Bug #13863]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 1ea1115aa5..b0312bfc04 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -920,4 +920,16 @@ class TestRubyOptions < Test::Unit::TestCase end end end + + def test_cwd_encoding + with_tmpchdir do + testdir = "\u30c6\u30b9\u30c8" + Dir.mkdir(testdir) + Dir.chdir(testdir) do + File.write("a.rb", "require './b'") + File.write("b.rb", "puts 'ok'") + assert_ruby_status([{"RUBYLIB"=>"."}, *%w[-E cp932:utf-8 a.rb]]) + end + end + end end |