diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-17 01:53:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-17 01:53:32 +0000 |
commit | f7a73f3e8bbf60a2cc44bbfbd6da71410e6dae83 (patch) | |
tree | 3381b5005ea765945e7868d090f3a3effd4c2468 /test/ruby/test_file_exhaustive.rb | |
parent | 43d08fee46887ed7a956877a4e86bc0600bccafc (diff) | |
download | ruby-f7a73f3e8bbf60a2cc44bbfbd6da71410e6dae83.tar.gz |
win32/file.c: fix drive letter
* win32/file.c (rb_file_expand_path_internal): do not make invalid
(or ADS) path if the path has a drive letter, the result also
should have be under it. [ruby-core:68130] [Bug #10858]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_file_exhaustive.rb')
-rw-r--r-- | test/ruby/test_file_exhaustive.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index c629461efd..96e36b9d69 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -795,6 +795,12 @@ class TestFileExhaustive < Test::Unit::TestCase assert_equal("#{Dir.pwd}/a/b/c", File.expand_path(obj)) end + def test_expand_path_with_drive_letter + bug10858 = '[ruby-core:68130] [Bug #10858]' + assert_match(%r'/bar/foo\z'i, File.expand_path('z:foo', 'bar'), bug10858) + assert_equal('z:/bar/foo', File.expand_path('z:foo', '/bar'), bug10858) + end if DRIVE + def test_basename assert_equal(File.basename(@file).sub(/\.test$/, ""), File.basename(@file, ".test")) assert_equal("", s = File.basename("")) |