longpath_test.go 510 B

12345678910111213141516171819202122
  1. package longpath
  2. import (
  3. "strings"
  4. "testing"
  5. )
  6. func TestStandardLongPath(t *testing.T) {
  7. c := `C:\simple\path`
  8. longC := AddPrefix(c)
  9. if !strings.EqualFold(longC, `\\?\C:\simple\path`) {
  10. t.Errorf("Wrong long path returned. Original = %s ; Long = %s", c, longC)
  11. }
  12. }
  13. func TestUNCLongPath(t *testing.T) {
  14. c := `\\server\share\path`
  15. longC := AddPrefix(c)
  16. if !strings.EqualFold(longC, `\\?\UNC\server\share\path`) {
  17. t.Errorf("Wrong UNC long path returned. Original = %s ; Long = %s", c, longC)
  18. }
  19. }