MCPcopy Create free account
hub / github.com/danielmiessler/Fabric / TestScanDirectory

Function TestScanDirectory

cmd/code2context/code_test.go:83–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestScanDirectory(t *testing.T) {
84 tmpDir := t.TempDir()
85
86 file1 := filepath.Join(tmpDir, "main.go")
87 require.NoError(t, os.WriteFile(file1, []byte("package main\n"), 0644))
88
89 jsonData, err := ScanDirectory(tmpDir, 3, "Test instructions", []string{})
90 require.NoError(t, err)
91
92 var result []any
93 err = json.Unmarshal(jsonData, &result)
94 require.NoError(t, err)
95 assert.Len(t, result, 3)
96
97 // Check instructions
98 instr := result[2].(map[string]any)
99 assert.Equal(t, "Test instructions", instr["details"])
100}

Callers

nothing calls this directly

Calls 1

ScanDirectoryFunction · 0.85

Tested by

no test coverage detected