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)
| 5 | // MakeTestSnapshot builds a Snapshot from a list of paths. Useful for |
| 6 | // query-level tests that don't need a real filesystem. |
| 7 | func 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. |
no test coverage detected