git-lfs/fs/fs_test.go

27 lines
605 B
Go
Raw Normal View History

2018-06-26 22:57:05 +00:00
package fs
import "testing"
func TestDecodeNone(t *testing.T) {
2018-06-13 14:56:46 +00:00
evaluate(t, "A:\\some\\regular\\windows\\path", "A:\\some\\regular\\windows\\path")
2018-06-26 22:57:05 +00:00
}
func TestDecodeSingle(t *testing.T) {
2018-06-13 14:56:46 +00:00
evaluate(t, "A:\\bl\\303\\204\\file.txt", "A:\\blÄ\\file.txt")
2018-06-26 22:57:05 +00:00
}
func TestDecodeMultiple(t *testing.T) {
2018-06-13 14:56:46 +00:00
evaluate(t, "A:\\fo\\130\\file\\303\\261.txt", "A:\\fo\130\\file\303\261.txt")
2018-06-26 22:57:05 +00:00
}
func evaluate(t *testing.T, input string, expected string) {
2018-06-13 14:56:46 +00:00
fs := Filesystem{}
2018-06-26 22:57:05 +00:00
output := fs.DecodePathname(input)
2018-06-13 14:56:46 +00:00
2018-06-26 22:57:05 +00:00
if output != expected {
2018-06-13 14:56:46 +00:00
t.Errorf("Expecting same path, got: %s, want: %s.", output, expected)
}
}