1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-25 18:15:57 +01:00

More tests for splitPath.

This commit is contained in:
Juliusz Chroboczek 2024-04-09 15:11:40 +02:00
parent eee6650336
commit c4c7d0b60d

View file

@ -98,13 +98,20 @@ func TestParseSplit(t *testing.T) {
a := []struct{ p, a, b, c string }{ a := []struct{ p, a, b, c string }{
{"", "", "", ""}, {"", "", "", ""},
{"/a", "/a", "", ""}, {"/a", "/a", "", ""},
{"/.a", "", ".a", ""},
{"/.a/", "", ".a", "/"},
{"/.a/b", "", ".a", "/b"},
{"/.a/b/", "", ".a", "/b/"},
{"/.a/b/c", "", ".a", "/b/c"},
{"/.a/b/c", "", ".a", "/b/c"},
{"/.a/b/.c/", "", ".a", "/b/.c/"},
{"/a/.b", "/a", ".b", ""}, {"/a/.b", "/a", ".b", ""},
{"/a/.b/", "/a", ".b", "/"}, {"/a/.b/", "/a", ".b", "/"},
{"/a/.b/c", "/a", ".b", "/c"}, {"/a/.b/c", "/a", ".b", "/c"},
{"/a/.b/c/", "/a", ".b", "/c/"}, {"/a/.b/c/", "/a", ".b", "/c/"},
{"/a/.b/c/d", "/a", ".b", "/c/d"}, {"/a/.b/c/d", "/a", ".b", "/c/d"},
{"/a/.b/c/d/", "/a", ".b", "/c/d/"}, {"/a/.b/c/d/", "/a", ".b", "/c/d/"},
{"/a/.b/c/d./", "/a", ".b", "/c/d./"}, {"/a/.b/c/.d/", "/a", ".b", "/c/.d/"},
} }
for _, pabc := range a { for _, pabc := range a {