summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-16 10:22:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-16 10:22:36 +0000
commitd0d70d648d7ef2a8c1de2f141b1ab5cda109d561 (patch)
treeaf8a6723a18286d1f50034f31fbd60b783f9b5b6 /sample
parent2f7275db779be068e3401376224601251f01046b (diff)
* file.c (file_expand_path): buffer might be reallocated while
expanding default directory. * file.c (file_expand_path): default directory was being ignored if path was full path with no drive letter, under DOSISH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 7194e07..d0a364f 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1675,13 +1675,21 @@ case Dir.pwd
when %r'\A\w:'
test_ok(/\A\w:\/\z/ =~ File.expand_path(".", "/"))
test_ok(/\A\w:\/a\z/ =~ File.expand_path("a", "/"))
+ dosish = true
when %r'\A//'
test_ok(%r'\A//[^/]+/[^/]+\z' =~ File.expand_path(".", "/"))
test_ok(%r'\A//[^/]+/[^/]+/a\z' =~ File.expand_path(".", "/"))
+ dosish = true
else
test_ok(File.expand_path(".", "/") == "/")
test_ok(File.expand_path("sub", "/") == "/sub")
end
+if dosish
+ test_ok(File.expand_path("/", "//machine/share/sub") == "//machine/share")
+ test_ok(File.expand_path("/dir", "//machine/share/sub") == "//machine/share/dir")
+ test_ok(File.expand_path("/", "z:/sub") == "z:/")
+ test_ok(File.expand_path("/dir", "z:/sub") == "z:/dir")
+end
test_ok(File.expand_path(".", "//") == "//")
test_ok(File.expand_path("sub", "//") == "//sub")