A Chunk is a portion of a source file. It contains a set of expected errors.
type Chunk struct { Source string // contains filtered or unexported fields }
func Read(filename string, report Reporter) (chunks []Chunk)
Read parses a chunked file and returns its chunks. It reports failures using the reporter.
Error messages of the form "file.star:line:col: ..." are prefixed by a newline so that the Go source position added by (*testing.T).Errorf appears on a separate line so as not to confused editors.
func (chunk *Chunk) Done()
Done should be called by the client to indicate that the chunk has no more errors. Done reports expected errors that did not occur to the chunk's reporter.
func (chunk *Chunk) GotError(linenum int, msg string)
GotError should be called by the client to report an error at a particular line. GotError reports unexpected errors to the chunk's reporter.
Reporter is implemented by *testing.T.
type Reporter interface { Errorf(format string, args ...interface{}) }