writeFile is a small wrapper that fails the test on write errors.
(t *testing.T, dir, name, body string)
| 32 | |
| 33 | // writeFile is a small wrapper that fails the test on write errors. |
| 34 | func writeFile(t *testing.T, dir, name, body string) string { |
| 35 | t.Helper() |
| 36 | path := filepath.Join(dir, name) |
| 37 | require.NoError(t, os.WriteFile(path, []byte(body), 0o644)) |
| 38 | return path |
| 39 | } |
| 40 | |
| 41 | // readFile returns the file's content or fails the test. |
| 42 | func readFile(t *testing.T, path string) string { |
no outgoing calls
no test coverage detected