Helper functions
(t *testing.T, repoPath, fileName, fileContent string)
| 207 | // Helper functions |
| 208 | |
| 209 | func createFile(t *testing.T, repoPath, fileName, fileContent string) { |
| 210 | t.Helper() |
| 211 | filePath := filepath.Join(repoPath, fileName) |
| 212 | |
| 213 | // Create directory if needed |
| 214 | dir := filepath.Dir(filePath) |
| 215 | if dir != repoPath { |
| 216 | err := os.MkdirAll(dir, 0755) |
| 217 | require.NoError(t, err, "failed to create directory") |
| 218 | } |
| 219 | |
| 220 | err := os.WriteFile(filePath, []byte(fileContent), 0644) |
| 221 | require.NoError(t, err, "failed to create file") |
| 222 | } |
| 223 | |
| 224 | func setupTestRepository(t *testing.T) (string, string) { |
| 225 | t.Helper() |
no test coverage detected