diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_file_exhaustive.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index af66b68123..c629461efd 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -440,13 +440,25 @@ class TestFileExhaustive < Test::Unit::TestCase def test_expand_path assert_equal(@file, File.expand_path(File.basename(@file), File.dirname(@file))) - if /cygwin|mingw|mswin|bccwin/ =~ RUBY_PLATFORM + case RUBY_PLATFORM + when /cygwin|mingw|mswin|bccwin/ assert_equal(@file, File.expand_path(@file + " ")) assert_equal(@file, File.expand_path(@file + ".")) assert_equal(@file, File.expand_path(@file + "::$DATA")) assert_match(/\Ac:\//i, File.expand_path('c:'), '[ruby-core:31591]') assert_match(/\Ac:\//i, File.expand_path('c:foo', 'd:/bar')) assert_match(%r'\Ac:/bar/foo\z'i, File.expand_path('c:foo', 'c:/bar')) + when /darwin/ + ["\u{feff}", *"\u{2000}"..."\u{2100}"].each do |c| + file = @file + c + begin + open(file) {} + rescue + assert_equal(file, File.expand_path(file), c.dump) + else + assert_equal(@file, File.expand_path(file), c.dump) + end + end end if DRIVE assert_match(%r"\Az:/foo\z"i, File.expand_path('/foo', "z:/bar")) |
