diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-15 19:37:18 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-15 19:37:18 +0000 |
commit | 12b6cd61c0740af71f12c4e1a247ee502e8e78dd (patch) | |
tree | 491734fac6669ed9f53f9995b9873a64a54bc5e8 /test | |
parent | ab61e5c932c96acd56d22c898bf67d960c1bb677 (diff) |
merge revision(s) 55385,55390: [Backport #12483]
* file.c (append_fspath): normalize directory name to be appended
on OS X. [ruby-core:75957] [Ruby trunk Bug#12483]
https://github.com/rails/rails/issues/25303#issuecomment-224834804
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_file_exhaustive.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index 9610523716..be0a79fdc9 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -1075,6 +1075,27 @@ class TestFileExhaustive < Test::Unit::TestCase assert_equal('z:/bar/foo', File.expand_path('z:foo', '/bar'), bug10858) end if DRIVE + case RUBY_PLATFORM + when /darwin/ + def test_expand_path_compose + pp = Object.new.extend(Test::Unit::Assertions) + def pp.mu_pp(str) #:nodoc: + str.dump + end + + Dir.mktmpdir do |dir| + Dir.chdir(dir) do + orig = %W"d\u{e9}tente x\u{304c 304e 3050 3052 3054}" + orig.each do |o| + Dir.mkdir(o) + n = Dir.chdir(o) {File.expand_path(".")} + pp.assert_equal(o, File.basename(n)) + end + end + end + end + end + def test_basename assert_equal(File.basename(regular_file).sub(/\.test$/, ""), File.basename(regular_file, ".test")) assert_equal(File.basename(utf8_file).sub(/\.test$/, ""), File.basename(utf8_file, ".test")) |