parser/gotest: Fix indent detection of test output

This commit is contained in:
Joël Stemmer
2018-04-28 01:06:54 +01:00
parent 73545440ce
commit 8ec797a84c
3 changed files with 149 additions and 16 deletions

View File

@ -128,10 +128,9 @@ func (p *parser) coverage(percent string) {
}
func (p *parser) output(line string) {
// TODO: Count indentations, however don't assume every tab is an indentation
var indent int
for indent = 0; strings.HasPrefix(line, "\t"); indent++ {
line = line[1:]
for indent = 0; strings.HasPrefix(line, " "); indent++ {
line = line[4:]
}
p.add(Event{
Type: "output",