commit 1f5ac72c069e3c3b21093b5ed388eba41978c072
parent b92b8fa19b10f8c0889dff7b995622bb8daf3ae3
Author: Matsuda Kenji <info@mtkn.jp>
Date: Fri, 19 Jan 2024 18:14:02 +0900
rename function
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/client/file_test.go b/client/file_test.go
@@ -27,7 +27,6 @@ func mount(ctx context.Context, fs lib9p.FS) (cfs *FS, err error) {
}
// TestFileStat tests whether Stat returns the same lib9p.Stat as testfs defines.
-// TODO: work in progress.
func TestFileStat(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cfs, err := mount(ctx, testfs)
@@ -35,13 +34,14 @@ func TestFileStat(t *testing.T) {
t.Fatal(err)
}
defer cancel()
- var testFileStat = func(path string, d fs.DirEntry, err error) error {
+ var walk = func(path string, d fs.DirEntry, err error) error {
cfi, err := fs.Stat(lib9p.ExportFS{FS: cfs}, path)
if err != nil {
if strings.Contains(err.Error(), "permission") {
return nil
}
t.Error(err)
+ return nil
}
tfi, err := fs.Stat(lib9p.ExportFS{FS: testfs}, path)
if err != nil {
@@ -52,7 +52,7 @@ func TestFileStat(t *testing.T) {
}
return nil
}
- if err := fs.WalkDir(lib9p.ExportFS{FS: testfs}, ".", testFileStat); err != nil {
+ if err := fs.WalkDir(lib9p.ExportFS{FS: testfs}, ".", walk); err != nil {
t.Error(err)
}
}