(filename string, now time.Time, data []byte)
| 89 | } |
| 90 | |
| 91 | func createFileTest(filename string, now time.Time, data []byte) fsTest { |
| 92 | return fsTest{ |
| 93 | { |
| 94 | name: "file/OpenFile", |
| 95 | f: func(t *testing.T, fs FS) { |
| 96 | verifyFileContentOpenFile(t, fs, filename, data) |
| 97 | }, |
| 98 | }, |
| 99 | { |
| 100 | name: "file/Open-error-not-exist", |
| 101 | f: func(t *testing.T, fs FS) { |
| 102 | _, err := fs.OpenFile(filename+"/other", O_RDONLY, false) |
| 103 | test.Assert(t, errors.Is(err, os.ErrNotExist), "unexpected error, got %v, expected %v", err, os.ErrNotExist) |
| 104 | }, |
| 105 | }, |
| 106 | { |
| 107 | name: "file/Lstat", |
| 108 | f: func(t *testing.T, fs FS) { |
| 109 | fi, err := fs.Lstat(filename) |
| 110 | test.OK(t, err) |
| 111 | |
| 112 | checkFileInfo(t, fi, filename, now, 0644, false) |
| 113 | }, |
| 114 | }, |
| 115 | { |
| 116 | name: "file/Stat", |
| 117 | f: func(t *testing.T, fs FS) { |
| 118 | fi := fsOpenAndStat(t, fs, filename, true) |
| 119 | checkFileInfo(t, fi, filename, now, 0644, false) |
| 120 | }, |
| 121 | }, |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func createDirTest(fpath string, now time.Time) fsTest { |
| 126 | return fsTest{ |
no test coverage detected