(t testing.TB, fs FS, filename string, want []byte)
| 16 | ) |
| 17 | |
| 18 | func verifyFileContentOpenFile(t testing.TB, fs FS, filename string, want []byte) { |
| 19 | f, err := fs.OpenFile(filename, O_RDONLY, false) |
| 20 | test.OK(t, err) |
| 21 | |
| 22 | buf, err := io.ReadAll(f) |
| 23 | test.OK(t, err) |
| 24 | test.OK(t, f.Close()) |
| 25 | |
| 26 | if !cmp.Equal(want, buf) { |
| 27 | t.Error(cmp.Diff(want, buf)) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | func verifyDirectoryContents(t testing.TB, fs FS, dir string, want []string) { |
| 32 | f, err := fs.OpenFile(dir, O_RDONLY, false) |