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

Function TestEngine_EmptyQueryReturnsEmpty

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

Source from the content-addressed store, hash-verified

140}
141
142func TestEngine_EmptyQueryReturnsEmpty(t *testing.T) {
143 t.Parallel()
144 dir := t.TempDir()
145 createFile(t, dir, "something.txt", "data")
146
147 eng, ctx := newTestEngine(t)
148 require.NoError(t, eng.AddRoot(ctx, dir))
149
150 results, err := eng.Search(ctx, "", filefinder.DefaultSearchOptions())
151 require.NoError(t, err)
152 require.Empty(t, results, "empty query should return no results")
153}
154
155func TestEngine_CloseIsClean(t *testing.T) {
156 t.Parallel()

Callers

nothing calls this directly

Calls 7

DefaultSearchOptionsFunction · 0.92
newTestEngineFunction · 0.85
AddRootMethod · 0.80
SearchMethod · 0.80
createFileFunction · 0.70
TempDirMethod · 0.65
EmptyMethod · 0.45

Tested by

no test coverage detected