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

Function TestIndex_Remove

agent/filefinder/delta_test.go:31–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestIndex_Remove(t *testing.T) {
32 t.Parallel()
33 idx := filefinder.NewIndex()
34 idx.Add("foo/bar.go", 0)
35 if !idx.Remove("foo/bar.go") {
36 t.Fatal("expected Remove to return true")
37 }
38 if idx.Has("foo/bar.go") {
39 t.Fatal("expected Has to return false after Remove")
40 }
41 if idx.Len() != 0 {
42 t.Fatalf("expected Len 0 after Remove, got %d", idx.Len())
43 }
44}
45
46func TestIndex_AddOverwrite(t *testing.T) {
47 t.Parallel()

Callers

nothing calls this directly

Calls 7

AddMethod · 0.95
RemoveMethod · 0.95
HasMethod · 0.95
LenMethod · 0.95
NewIndexFunction · 0.92
FatalMethod · 0.80
FatalfMethod · 0.45

Tested by

no test coverage detected