(t *testing.T, filesystem fs.Filesystem, name string)
| 168 | } |
| 169 | |
| 170 | func readFile(t *testing.T, filesystem fs.Filesystem, name string) string { |
| 171 | t.Helper() |
| 172 | fd, err := filesystem.Open(name) |
| 173 | if err != nil { |
| 174 | t.Fatal(err) |
| 175 | } |
| 176 | defer fd.Close() |
| 177 | buf, err := io.ReadAll(fd) |
| 178 | if err != nil { |
| 179 | t.Fatal(err) |
| 180 | } |
| 181 | return string(buf) |
| 182 | } |
| 183 | |
| 184 | func writeFile(t *testing.T, filesystem fs.Filesystem, name, content string) { |
| 185 | fd, err := filesystem.OpenFile(name, fs.OptReadWrite|fs.OptCreate, 0o777) |
no test coverage detected