mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-04-08 06:28:08 -05:00
Only strip the first tab from the output
This commit is contained in:
parent
a6dab641a1
commit
e0174f066f
@ -59,8 +59,8 @@ var testCases []TestCase = []TestCase{
|
|||||||
Output: []string{
|
Output: []string{
|
||||||
"file_test.go:11: Error message",
|
"file_test.go:11: Error message",
|
||||||
"file_test.go:11: Longer",
|
"file_test.go:11: Longer",
|
||||||
"error",
|
"\terror",
|
||||||
"message.",
|
"\tmessage.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -130,7 +130,7 @@ func TestParser(t *testing.T) {
|
|||||||
testOutput := strings.Join(test.Output, "\n")
|
testOutput := strings.Join(test.Output, "\n")
|
||||||
expTestOutput := strings.Join(expTest.Output, "\n")
|
expTestOutput := strings.Join(expTest.Output, "\n")
|
||||||
if testOutput != expTestOutput {
|
if testOutput != expTestOutput {
|
||||||
t.Errorf("Test.Output ==\n%s, want\n%s", testOutput, expTestOutput)
|
t.Errorf("Test.Output ==\n%s\n, want\n%s", testOutput, expTestOutput)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ func Parse(r io.Reader) (*Report, error) {
|
|||||||
test.Time = parseTime(matches[3]) * 10
|
test.Time = parseTime(matches[3]) * 10
|
||||||
} else if strings.HasPrefix(line, "\t") {
|
} else if strings.HasPrefix(line, "\t") {
|
||||||
// test output
|
// test output
|
||||||
test.Output = append(test.Output, strings.TrimLeft(line, "\t"))
|
test.Output = append(test.Output, line[1:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<testcase classname="name" name="TestOne" time="0.020">
|
<testcase classname="name" name="TestOne" time="0.020">
|
||||||
<failure message="Failed" type="">file_test.go:11: Error message
|
<failure message="Failed" type="">file_test.go:11: Error message
|
||||||
file_test.go:11: Longer
|
file_test.go:11: Longer
|
||||||
error
|
error
|
||||||
message.</failure>
|
message.</failure>
|
||||||
</testcase>
|
</testcase>
|
||||||
<testcase classname="name" name="TestTwo" time="0.130"></testcase>
|
<testcase classname="name" name="TestTwo" time="0.130"></testcase>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user