mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-07-03 20:52:47 -05:00
Fix regular expression for summary with "no statements" coverage.
Move the status message to the end of the regular expression.
This commit is contained in:
@ -37,11 +37,12 @@ var (
|
||||
`(?:\s+(\d+\.\d+)s)?` +
|
||||
// 4: cached indicator (optional)
|
||||
`(?:\s+(\(cached\)))?` +
|
||||
// 5: [status message] (optional)
|
||||
// 5: coverage percentage (optional)
|
||||
// 6: coverage package list (optional)
|
||||
`(?:\s+coverage:\s+(?:\[no\sstatements\]|(\d+\.\d+)%\sof\sstatements(?:\sin\s(.+))?))?` +
|
||||
// 7: [status message] (optional)
|
||||
`(?:\s+(\[[^\]]+\]))?` +
|
||||
// 6: coverage percentage (optional)
|
||||
// 7: coverage package list (optional)
|
||||
`(?:\s+coverage:\s+(\d+\.\d+)%\sof\sstatements(?:\sin\s(.+))?)?$`)
|
||||
`$`)
|
||||
)
|
||||
|
||||
// Option defines options that can be passed to gotest.New.
|
||||
@ -200,7 +201,7 @@ func (p *Parser) parseLine(line string) (events []Event) {
|
||||
} else if matches := regexStatus.FindStringSubmatch(line); len(matches) == 2 {
|
||||
return p.status(matches[1])
|
||||
} else if matches := regexSummary.FindStringSubmatch(line); len(matches) == 8 {
|
||||
return p.summary(matches[1], matches[2], matches[3], matches[4], matches[5], matches[6], matches[7])
|
||||
return p.summary(matches[1], matches[2], matches[3], matches[4], matches[7], matches[5], matches[6])
|
||||
} else if matches := regexCoverage.FindStringSubmatch(line); len(matches) == 3 {
|
||||
return p.coverage(matches[1], matches[2])
|
||||
} else if matches := regexBenchmark.FindStringSubmatch(line); len(matches) == 2 {
|
||||
|
Reference in New Issue
Block a user