lib/fs: Basic with empty root shouldn't point at / (#6483)

This commit is contained in:
Simon Frei
2020-03-31 13:56:07 +02:00
committed by GitHub
parent 9c67d57c28
commit 123941cf62
2 changed files with 10 additions and 1 deletions
+6 -1
View File
@@ -514,6 +514,10 @@ func TestNewBasicFilesystem(t *testing.T) {
t.Skip("non-windows root paths")
}
currentDir, err := filepath.Abs(".")
if err != nil {
t.Fatal(err)
}
testCases := []struct {
input string
expectedRoot string
@@ -521,7 +525,8 @@ func TestNewBasicFilesystem(t *testing.T) {
}{
{"/foo/bar/baz", "/foo/bar/baz", "/foo/bar/baz"},
{"/foo/bar/baz/", "/foo/bar/baz", "/foo/bar/baz"},
{"", "/", "/"},
{"", currentDir, currentDir},
{".", currentDir, currentDir},
{"/", "/", "/"},
}