--- helpers ---
(t *testing.T, path string)
| 294 | // --- helpers --- |
| 295 | |
| 296 | func readCSV(t *testing.T, path string) [][]string { |
| 297 | t.Helper() |
| 298 | raw, err := os.ReadFile(path) |
| 299 | require.NoError(t, err) |
| 300 | // Skip UTF-8 BOM if present |
| 301 | content := string(raw) |
| 302 | if strings.HasPrefix(content, string(utf8BOM)) { |
| 303 | content = content[len(utf8BOM):] |
| 304 | } |
| 305 | reader := csv.NewReader(strings.NewReader(content)) |
| 306 | records, err := reader.ReadAll() |
| 307 | require.NoError(t, err) |
| 308 | return records |
| 309 | } |
| 310 | |
| 311 | func readJSON(t *testing.T, path string, v any) { |
| 312 | t.Helper() |
no outgoing calls
no test coverage detected