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

Function MakeTestSnapshot

agent/filefinder/export_test.go:7–13  ·  view source on GitHub ↗

Test helpers that need internal access. MakeTestSnapshot builds a Snapshot from a list of paths. Useful for query-level tests that don't need a real filesystem.

(paths []string)

Source from the content-addressed store, hash-verified

5// MakeTestSnapshot builds a Snapshot from a list of paths. Useful for
6// query-level tests that don't need a real filesystem.
7func MakeTestSnapshot(paths []string) *Snapshot {
8 idx := NewIndex()
9 for _, p := range paths {
10 idx.Add(p, 0)
11 }
12 return idx.Snapshot()
13}
14
15// BuildTestIndex walks root and returns a populated Index, the same
16// way Engine.AddRoot does but without starting a watcher.

Calls 3

AddMethod · 0.95
SnapshotMethod · 0.95
NewIndexFunction · 0.85

Tested by

no test coverage detected