createFile creates a file (and parent dirs) at relPath under dir.
(t *testing.T, dir, relPath, content string)
| 217 | |
| 218 | // createFile creates a file (and parent dirs) at relPath under dir. |
| 219 | func createFile(t *testing.T, dir, relPath, content string) { |
| 220 | t.Helper() |
| 221 | full := filepath.Join(dir, relPath) |
| 222 | require.NoError(t, os.MkdirAll(filepath.Dir(full), 0o755)) |
| 223 | require.NoError(t, os.WriteFile(full, []byte(content), 0o600)) |
| 224 | } |
| 225 | |
| 226 | func resultPaths(results []filefinder.Result) []string { |
| 227 | paths := make([]string, len(results)) |
no test coverage detected