MCPcopy Index your code
hub / github.com/coder/coder / TestEngine_SearchFindsKnownFile

Function TestEngine_SearchFindsKnownFile

agent/filefinder/engine_test.go:36–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

34}
35
36func TestEngine_SearchFindsKnownFile(t *testing.T) {
37 t.Parallel()
38 dir := t.TempDir()
39 createFile(t, dir, "src/main.go", "package main")
40 createFile(t, dir, "src/handler.go", "package main")
41 createFile(t, dir, "README.md", "# hello")
42
43 eng, ctx := newTestEngine(t)
44 require.NoError(t, eng.AddRoot(ctx, dir))
45
46 results, err := eng.Search(ctx, "main.go", filefinder.DefaultSearchOptions())
47 require.NoError(t, err)
48 require.NotEmpty(t, results, "expected to find main.go")
49 requireResultHasPath(t, results, "src/main.go")
50}
51
52func TestEngine_SearchFuzzyMatch(t *testing.T) {
53 t.Parallel()

Callers

nothing calls this directly

Calls 8

DefaultSearchOptionsFunction · 0.92
newTestEngineFunction · 0.85
requireResultHasPathFunction · 0.85
AddRootMethod · 0.80
SearchMethod · 0.80
NotEmptyMethod · 0.80
createFileFunction · 0.70
TempDirMethod · 0.65

Tested by

no test coverage detected