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

Function TestSearchSnapshot_FuzzyFallbackEndToEnd

agent/filefinder/query_test.go:332–343  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

330}
331
332func TestSearchSnapshot_FuzzyFallbackEndToEnd(t *testing.T) {
333 t.Parallel()
334 snap := filefinder.MakeTestSnapshot([]string{"src/handler.go", "src/middleware.go", "pkg/config.go"})
335 plan := filefinder.NewQueryPlanForTest("hndlr")
336 results := filefinder.MergeAndScoreForTest(filefinder.SearchSnapshotForTest(plan, snap, 100), plan, filefinder.DefaultScoreParamsForTest(), 10)
337 if len(results) == 0 {
338 t.Fatal("expected fuzzy fallback to produce scored results for 'hndlr'")
339 }
340 if results[0].Path != "src/handler.go" {
341 t.Errorf("expected top result 'src/handler.go', got %q", results[0].Path)
342 }
343}

Callers

nothing calls this directly

Calls 3

MakeTestSnapshotFunction · 0.92
FatalMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected