fs/reader: test file not exist case

This commit is contained in:
Michael Eischer
2025-04-11 21:57:45 +02:00
parent 6e91ea3397
commit ddd48f1e98

View File

@@ -96,6 +96,13 @@ func createFileTest(filename string, now time.Time, data []byte) fsTest {
verifyFileContentOpenFile(t, fs, filename, data)
},
},
{
name: "file/Open-error-not-exist",
f: func(t *testing.T, fs FS) {
_, err := fs.OpenFile(filename+"/other", O_RDONLY, false)
test.Assert(t, errors.Is(err, os.ErrNotExist), "unexpected error, got %v, expected %v", err, os.ErrNotExist)
},
},
{
name: "file/Lstat",
f: func(t *testing.T, fs FS) {