github.com/cdoern/storage@v1.12.13/pkg/longpath/longpath_test.go (about)

     1  package 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  }