github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/pkg/longpath/longpath_test.go (about) 1 package longpath // import "github.com/demonoid81/moby/pkg/longpath" 2 3 import ( 4 "strings" 5 "testing" 6 ) 7 8 func TestStandardLongPath(t *testing.T) { 9 c := `C:\simple\path` 10 longC := AddPrefix(c) 11 if !strings.EqualFold(longC, `\\?\C:\simple\path`) { 12 t.Errorf("Wrong long path returned. Original = %s ; Long = %s", c, longC) 13 } 14 } 15 16 func TestUNCLongPath(t *testing.T) { 17 c := `\\server\share\path` 18 longC := AddPrefix(c) 19 if !strings.EqualFold(longC, `\\?\UNC\server\share\path`) { 20 t.Errorf("Wrong UNC long path returned. Original = %s ; Long = %s", c, longC) 21 } 22 }