summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 1d45b97d9f..cd2760a72f 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -397,7 +397,15 @@ class TestFileExhaustive < Test::Unit::TestCase
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_equal('c:/bar/foo', File.expand_path('c:foo', 'c:/bar'))
+ assert_equal('C:/bar/foo', File.expand_path('c:foo', 'C:/bar'))
end
+ if drive = Dir.pwd[%r'\A(?:[a-z]:|//[^/]+/[^/]+)'i]
+ assert_equal("z:/foo", File.expand_path('/foo', "z:/bar"))
+ assert_equal("//host/share/foo", File.expand_path('/foo', "//host/share/bar"))
+ end
+ assert_equal("#{drive}/foo", File.expand_path('/foo'))
assert_kind_of(String, File.expand_path("~")) if ENV["HOME"]
assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") }
assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha", "/") }