Windows: Fixing longpath hanlding of UNC paths.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
This commit is contained in:
parent
92c1310f61
commit
09a9d216d9
2 changed files with 28 additions and 1 deletions
22
longpath/longpath_test.go
Normal file
22
longpath/longpath_test.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package longpath
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestStandardLongPath(t *testing.T) {
|
||||
c := `C:\simple\path`
|
||||
longC := AddPrefix(c)
|
||||
if !strings.EqualFold(longC, `\\?\C:\simple\path`) {
|
||||
t.Errorf("Wrong long path returned. Original = %s ; Long = %s", c, longC)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUNCLongPath(t *testing.T) {
|
||||
c := `\\server\share\path`
|
||||
longC := AddPrefix(c)
|
||||
if !strings.EqualFold(longC, `\\?\UNC\server\share\path`) {
|
||||
t.Errorf("Wrong UNC long path returned. Original = %s ; Long = %s", c, longC)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue