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

Function TestEngine_CloseIsClean

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

Source from the content-addressed store, hash-verified

153}
154
155func TestEngine_CloseIsClean(t *testing.T) {
156 t.Parallel()
157 dir := t.TempDir()
158 createFile(t, dir, "file.txt", "data")
159
160 logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}).Leveled(slog.LevelDebug)
161 ctx := context.Background()
162 eng := filefinder.NewEngine(logger)
163 require.NoError(t, eng.AddRoot(ctx, dir))
164 require.NoError(t, eng.Close())
165
166 _, err := eng.Search(ctx, "file", filefinder.DefaultSearchOptions())
167 require.Error(t, err)
168}
169
170func TestEngine_AddRootIdempotent(t *testing.T) {
171 t.Parallel()

Callers

nothing calls this directly

Calls 8

AddRootMethod · 0.95
CloseMethod · 0.95
SearchMethod · 0.95
NewEngineFunction · 0.92
DefaultSearchOptionsFunction · 0.92
createFileFunction · 0.70
TempDirMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected