github.com/git-lfs/git-lfs@v2.5.2+incompatible/fs/fs_test.go (about)

     1  package fs
     2  
     3  import "testing"
     4  
     5  func TestDecodeNone(t *testing.T) {
     6  	evaluate(t, "A:\\some\\regular\\windows\\path", "A:\\some\\regular\\windows\\path")
     7  }
     8  
     9  func TestDecodeSingle(t *testing.T) {
    10  	evaluate(t, "A:\\bl\\303\\204\\file.txt", "A:\\blÄ\\file.txt")
    11  }
    12  
    13  func TestDecodeMultiple(t *testing.T) {
    14  	evaluate(t, "A:\\fo\\130\\file\\303\\261.txt", "A:\\fo\130\\file\303\261.txt")
    15  }
    16  
    17  func evaluate(t *testing.T, input string, expected string) {
    18  
    19  	fs := Filesystem{}
    20  	output := fs.DecodePathname(input)
    21  
    22  	if output != expected {
    23  		t.Errorf("Expecting same path, got: %s, want: %s.", output, expected)
    24  	}
    25  
    26  }