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

Function TestIndex_Has

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

Source from the content-addressed store, hash-verified

17}
18
19func TestIndex_Has(t *testing.T) {
20 t.Parallel()
21 idx := filefinder.NewIndex()
22 idx.Add("foo/bar.go", 0)
23 if !idx.Has("foo/bar.go") {
24 t.Fatal("expected Has to return true")
25 }
26 if idx.Has("foo/missing.go") {
27 t.Fatal("expected Has to return false for missing path")
28 }
29}
30
31func TestIndex_Remove(t *testing.T) {
32 t.Parallel()

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
HasMethod · 0.95
NewIndexFunction · 0.92
FatalMethod · 0.80

Tested by

no test coverage detected