MCPcopy Create free account
hub / github.com/coder/coder / TestIndex_AddAndLen

Function TestIndex_AddAndLen

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

Source from the content-addressed store, hash-verified

7)
8
9func TestIndex_AddAndLen(t *testing.T) {
10 t.Parallel()
11 idx := filefinder.NewIndex()
12 idx.Add("foo/bar.go", 0)
13 idx.Add("foo/baz.go", 0)
14 if idx.Len() != 2 {
15 t.Fatalf("expected 2, got %d", idx.Len())
16 }
17}
18
19func TestIndex_Has(t *testing.T) {
20 t.Parallel()

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
LenMethod · 0.95
NewIndexFunction · 0.92
FatalfMethod · 0.45

Tested by

no test coverage detected