summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 07:01:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 07:01:22 +0000
commitf0806c4863c4440f9644ef0aea233739269ed45a (patch)
tree46f181a4f0baf86620a217a287f214e25f669273 /test
parent0ebfc6f216f86a97d766d9ae2b525bd41b50286f (diff)
file.c: drop ignored chars
* file.c (rb_file_expand_path_internal): drop characters ignored by filesystem on Mac OS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb14
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"))