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

Function TestEngine_RemoveRoot

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

Source from the content-addressed store, hash-verified

181}
182
183func TestEngine_RemoveRoot(t *testing.T) {
184 t.Parallel()
185 dir := t.TempDir()
186 createFile(t, dir, "file.txt", "data")
187
188 eng, ctx := newTestEngine(t)
189 require.NoError(t, eng.AddRoot(ctx, dir))
190
191 results, err := eng.Search(ctx, "file", filefinder.DefaultSearchOptions())
192 require.NoError(t, err)
193 require.NotEmpty(t, results)
194
195 require.NoError(t, eng.RemoveRoot(dir))
196
197 results, err = eng.Search(ctx, "file", filefinder.DefaultSearchOptions())
198 require.NoError(t, err)
199 require.Empty(t, results)
200}
201
202func TestEngine_Rebuild(t *testing.T) {
203 t.Parallel()

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected