File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ elseif is_windows()
34
34
const path_ext_splitter = r" ^((?:.*[/\\ ])?(?:\. |[^/\\\. ])[^/\\ ]*?)(\. [^/\\\. ]*|)$"
35
35
36
36
function splitdrive (path:: String )
37
- m = match (r" ^(\w +:|\\\\\w +\\\w +|\\\\\?\\ UNC\\\w +\\\w +|\\\\\?\\\w +:|)(.*)$" , path)
37
+ m = match (r" ^([^ \\ ] +:|\\\\ [^ \\ ] +\\ [^ \\ ] +|\\\\\?\\ UNC\\ [^ \\ ] +\\ [^ \\ ] +|\\\\\?\\ [^ \\ ] +:|)(.*)$" , path)
38
38
String (m. captures[1 ]), String (m. captures[2 ])
39
39
end
40
40
else
Original file line number Diff line number Diff line change @@ -68,6 +68,15 @@ for S in (String, GenericString)
68
68
@test joinpath (splitdir (S (homedir ()))... ) == homedir ()
69
69
@test string (splitdrive (S (homedir ()))... ) == homedir ()
70
70
71
+ if is_windows ()
72
+ @test splitdrive (S (" \\\\ servername\\ hello.world\\ filename.ext" )) ==
73
+ (" \\\\ servername\\ hello.world" ," \\ filename.ext" )
74
+ @test splitdrive (S (" \\\\ servername.com\\ hello.world\\ filename.ext" )) ==
75
+ (" \\\\ servername.com\\ hello.world" ," \\ filename.ext" )
76
+ @test splitdrive (S (" C:\\ foo\\ bar" )) ==
77
+ (" C:" ," \\ foo\\ bar" )
78
+ end
79
+
71
80
@test splitext (S (" " )) == (" " , " " )
72
81
@test splitext (S (" ." )) == (" ." , " " )
73
82
@test_broken splitext (S (" .." )) == (" .." , " " )
You can’t perform that action at this time.
0 commit comments