From 797f2eda58dd68965d6ddcaab450f535513e3797 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 12 Jun 2016 00:24:36 +0000 Subject: file.c: normalize cwd * 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/trunk@55385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_file_exhaustive.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index d9d93444f3..5b02077410 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -1094,6 +1094,24 @@ class TestFileExhaustive < Test::Unit::TestCase assert_equal('z:/bar/foo', File.expand_path('z:foo', '/bar'), bug10858) end if DRIVE + 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 + 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")) -- cgit v1.2.3