File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ package junit
6
6
7
7
import (
8
8
"strconv"
9
+ "strings"
9
10
"time"
10
11
)
11
12
@@ -103,6 +104,9 @@ func ingestError(root xmlNode) Error {
103
104
}
104
105
105
106
func duration (t string ) time.Duration {
107
+ // Remove commas for larger durations
108
+ t = strings .ReplaceAll (t , "," , "" )
109
+
106
110
// Check if there was a valid decimal value
107
111
if s , err := strconv .ParseFloat (t , 64 ); err == nil {
108
112
return time .Duration (s * 1000000 ) * time .Microsecond
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ func TestExamplesInTheWild(t *testing.T) {
113
113
var testcase = Test {
114
114
Name : "testStdoutStderr" ,
115
115
Classname : "com.example.FooTest" ,
116
- Duration : 9 * time .Millisecond ,
116
+ Duration : 1234560 * time .Millisecond ,
117
117
Status : StatusFailed ,
118
118
Error : Error {
119
119
Type : "java.lang.AssertionError" ,
@@ -122,7 +122,7 @@ func TestExamplesInTheWild(t *testing.T) {
122
122
Properties : map [string ]string {
123
123
"classname" : "com.example.FooTest" ,
124
124
"name" : "testStdoutStderr" ,
125
- "time" : "0.009 " ,
125
+ "time" : "1,234.56 " ,
126
126
},
127
127
SystemOut : "Hello, World\n " ,
128
128
SystemErr : "I'm an error!\n " ,
Original file line number Diff line number Diff line change 47
47
<property name =" sun.io.unicode.encoding" value =" UnicodeBig" />
48
48
<property name =" java.class.version" value =" 55.0" />
49
49
</properties >
50
- <testcase name =" testStdoutStderr" classname =" com.example.FooTest" time =" 0.009 " >
50
+ <testcase name =" testStdoutStderr" classname =" com.example.FooTest" time =" 1,234.56 " >
51
51
<failure type =" java.lang.AssertionError" >java.lang.AssertionError
52
52
at com.example.FooTest.testStdoutStderr(FooTest.java:13)
53
53
</failure >
You can’t perform that action at this time.
0 commit comments