MCPcopy Create free account
hub / github.com/diillson/chatcli / BenchmarkProcessDirectory

Function BenchmarkProcessDirectory

utils/file_utils_test.go:29–50  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

27}
28
29func BenchmarkProcessDirectory(b *testing.B) {
30 // 1. Setup do ambiente de teste
31 tempDir, err := os.MkdirTemp("", "benchmark-processdir-*")
32 if err != nil {
33 b.Fatalf("Failed to create temp dir: %v", err)
34 }
35 defer os.RemoveAll(tempDir)
36
37 createTestDirStructure(nil, tempDir)
38 logger, _ := zap.NewDevelopment()
39 options := DefaultDirectoryScanOptions(logger)
40
41 // 2. Rodar o benchmark
42 b.ResetTimer() // Inicia a contagem de tempo
43 for i := 0; i < b.N; i++ {
44 // A função a ser benchmarkada
45 _, err := ProcessDirectory(context.Background(), tempDir, options)
46 if err != nil {
47 b.Fatalf("ProcessDirectory failed: %v", err)
48 }
49 }
50}
51
52func TestProcessDirectory(t *testing.T) {
53 tempDir, err := os.MkdirTemp("", "test-processdir-*")

Callers

nothing calls this directly

Calls 3

createTestDirStructureFunction · 0.85
ProcessDirectoryFunction · 0.85

Tested by

no test coverage detected