MCPcopy Create free account
hub / github.com/coder/coder / TestSearchSnapshot_TrigramMatch

Function TestSearchSnapshot_TrigramMatch

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

Source from the content-addressed store, hash-verified

107}
108
109func TestSearchSnapshot_TrigramMatch(t *testing.T) {
110 t.Parallel()
111 snap := filefinder.MakeTestSnapshot([]string{"src/handler.go", "src/router.go", "lib/utils.go"})
112 cands := filefinder.SearchSnapshotForTest(filefinder.NewQueryPlanForTest("handler"), snap, 100)
113 if len(cands) == 0 {
114 t.Fatal("expected at least 1 candidate for 'handler'")
115 }
116 requireCandHasPath(t, cands, "src/handler.go")
117}
118
119func TestSearchSnapshot_ShortQuery(t *testing.T) {
120 t.Parallel()

Callers

nothing calls this directly

Calls 3

MakeTestSnapshotFunction · 0.92
requireCandHasPathFunction · 0.85
FatalMethod · 0.80

Tested by

no test coverage detected