Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct { // Matches is a counter of matches for this matcher. // Expected to be set by the user. Matches int // contains filtered or unexported fields }
Matcher is a single parsed magic comment that is used to match tested program output.
func (*Matcher) MatchWithLine ¶
MatchWithLine does text+position matching.
Like Match, but also checks that m.Position().Line is equal to the provided line argument.
type TestFile ¶
type TestFile struct { // Matchers is a mapping from source code line to the // list of matchers for it. Matchers map[int][]*Matcher // contains filtered or unexported fields }
TestFile represents parsed end2end test file.
func ParseTestFile ¶
ParseTestFile parses file at specified path using the parser with default settings.
type TestParser ¶
type TestParser struct { // MatcherRE is used to distinguish comments that describe matchers // and also to capture their text. // // Regexp must include 2 capture groups: // 1. Matches [=~]. This determines the matcher kind (text or regexp) // 2. Matches text being matched. Usually something like ".*" // // If nil, defaultMatcherRE is used. You can use it as an example. MatcherRE *regexp.Regexp }
TestParser is a end2end source file parser.
Click to show internal directories.
Click to hide internal directories.