2018-02-05 16:05:59 -05:00
|
|
|
package longpath // import "github.com/docker/docker/pkg/longpath"
|
2015-09-25 17:00:56 -04:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|