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

Function TestEngine_AddRootIdempotent

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

Source from the content-addressed store, hash-verified

168}
169
170func TestEngine_AddRootIdempotent(t *testing.T) {
171 t.Parallel()
172 dir := t.TempDir()
173 createFile(t, dir, "file.txt", "data")
174
175 eng, ctx := newTestEngine(t)
176 require.NoError(t, eng.AddRoot(ctx, dir))
177 require.NoError(t, eng.AddRoot(ctx, dir))
178
179 snapLen := filefinder.EngineSnapLen(eng)
180 require.Equal(t, 1, snapLen, "expected exactly one root after duplicate add")
181}
182
183func TestEngine_RemoveRoot(t *testing.T) {
184 t.Parallel()

Callers

nothing calls this directly

Calls 6

EngineSnapLenFunction · 0.92
newTestEngineFunction · 0.85
AddRootMethod · 0.80
createFileFunction · 0.70
TempDirMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected