(t *testing.T)
| 326 | } |
| 327 | |
| 328 | func TestGitIgnoreCacheNil(t *testing.T) { |
| 329 | // Test that ScanFiles works with nil cache (no gitignore) |
| 330 | tmpDir := t.TempDir() |
| 331 | |
| 332 | if err := os.WriteFile(filepath.Join(tmpDir, "file.go"), []byte("package main"), 0644); err != nil { |
| 333 | t.Fatal(err) |
| 334 | } |
| 335 | if err := os.WriteFile(filepath.Join(tmpDir, "file.log"), []byte("log"), 0644); err != nil { |
| 336 | t.Fatal(err) |
| 337 | } |
| 338 | |
| 339 | // Scan without gitignore cache |
| 340 | files, err := ScanFiles(tmpDir, nil, nil, nil) |
| 341 | if err != nil { |
| 342 | t.Fatalf("ScanFiles failed: %v", err) |
| 343 | } |
| 344 | |
| 345 | // Should include both files |
| 346 | if len(files) != 2 { |
| 347 | t.Errorf("Expected 2 files, got %d", len(files)) |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | // TestNestedGitignoreMonorepo simulates the issue #6 scenario: |
| 352 | // A monorepo with multiple projects, each with their own .gitignore |
nothing calls this directly
no test coverage detected