(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestProcessDirectory(t *testing.T) { |
| 53 | tempDir, err := os.MkdirTemp("", "test-processdir-*") |
| 54 | require.NoError(t, err) |
| 55 | defer os.RemoveAll(tempDir) |
| 56 | |
| 57 | createTestDirStructure(t, tempDir) |
| 58 | logger, _ := zap.NewDevelopment() |
| 59 | options := DefaultDirectoryScanOptions(logger) |
| 60 | |
| 61 | files, err := ProcessDirectory(context.Background(), tempDir, options) |
| 62 | require.NoError(t, err) |
| 63 | |
| 64 | // Deve encontrar 3 arquivos: main.go, button.js, README.md |
| 65 | assert.Len(t, files, 3) |
| 66 | |
| 67 | foundPaths := make(map[string]bool) |
| 68 | for _, f := range files { |
| 69 | // Normalizar o path para a comparação |
| 70 | relPath, err := filepath.Rel(tempDir, f.Path) |
| 71 | require.NoError(t, err) |
| 72 | foundPaths[relPath] = true |
| 73 | } |
| 74 | |
| 75 | assert.True(t, foundPaths["main.go"]) |
| 76 | assert.True(t, foundPaths[filepath.Join("src/components/button.js")]) |
| 77 | assert.True(t, foundPaths["README.md"]) |
| 78 | } |
| 79 | |
| 80 | func TestProcessDirectory_WithLimits(t *testing.T) { |
| 81 | tempDir, err := os.MkdirTemp("", "test-limits-*") |
nothing calls this directly
no test coverage detected