git-lfs/fs/fs_test.go
Christian Buehlmann 00de87a544 add unittests
2018-06-27 00:57:05 +02:00

27 lines
605 B
Go

package fs
import "testing"
func TestDecodeNone(t *testing.T) {
evaluate(t, "A:\\some\\regular\\windows\\path", "A:\\some\\regular\\windows\\path")
}
func TestDecodeSingle(t *testing.T) {
evaluate(t, "A:\\bl\\303\\204\\file.txt", "A:\\blÄ\\file.txt")
}
func TestDecodeMultiple(t *testing.T) {
evaluate(t, "A:\\fo\\130\\file\\303\\261.txt", "A:\\fo\130\\file\303\261.txt")
}
func evaluate(t *testing.T, input string, expected string) {
fs := Filesystem{}
output := fs.DecodePathname(input)
if output != expected {
t.Errorf("Expecting same path, got: %s, want: %s.", output, expected)
}
}