Documentation
¶
Overview ¶
Package indextest holds a recording tools.Index double: a test checks that a run builds one code-search index, hands the same instance to its Runner and to specgen's Options, and closes it once on every exit path.
It is imported only from tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
// Kind is "invalidate" or "close".
Kind string
// Rel is the path argument of an invalidate.
Rel string
// Seq is the call's place in the process-wide order; see Next.
Seq int64
}
Event is one recorded call on an Index.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is a tools.Index that records Invalidate and Close calls. Its Tools returns a code_search tool with an Execute func, as the real index does.
func (*Index) Close ¶
Close records the call. Like the real index's, it is safe to call twice; CloseCalls is how a test sees that it was.
func (*Index) CloseCalls ¶
CloseCalls is how many times Close was called.
func (*Index) InvalidateCalls ¶
InvalidateCalls is how many times Invalidate was called.