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
66
77import (
88 "strconv"
9+ "strings"
910 "time"
1011)
1112
@@ -103,6 +104,9 @@ func ingestError(root xmlNode) Error {
103104}
104105
105106func duration (t string ) time.Duration {
107+ // Remove commas for larger durations
108+ t = strings .ReplaceAll (t , "," , "" )
109+
106110 // Check if there was a valid decimal value
107111 if s , err := strconv .ParseFloat (t , 64 ); err == nil {
108112 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) {
113113 var testcase = Test {
114114 Name : "testStdoutStderr" ,
115115 Classname : "com.example.FooTest" ,
116- Duration : 9 * time .Millisecond ,
116+ Duration : 1234560 * time .Millisecond ,
117117 Status : StatusFailed ,
118118 Error : Error {
119119 Type : "java.lang.AssertionError" ,
@@ -122,7 +122,7 @@ func TestExamplesInTheWild(t *testing.T) {
122122 Properties : map [string ]string {
123123 "classname" : "com.example.FooTest" ,
124124 "name" : "testStdoutStderr" ,
125- "time" : "0.009 " ,
125+ "time" : "1,234.56 " ,
126126 },
127127 SystemOut : "Hello, World\n " ,
128128 SystemErr : "I'm an error!\n " ,
Original file line number Diff line number Diff line change 4747 <property name =" sun.io.unicode.encoding" value =" UnicodeBig" />
4848 <property name =" java.class.version" value =" 55.0" />
4949 </properties >
50- <testcase name =" testStdoutStderr" classname =" com.example.FooTest" time =" 0.009 " >
50+ <testcase name =" testStdoutStderr" classname =" com.example.FooTest" time =" 1,234.56 " >
5151 <failure type =" java.lang.AssertionError" >java.lang.AssertionError
5252 at com.example.FooTest.testStdoutStderr(FooTest.java:13)
5353</failure >
You can’t perform that action at this time.
0 commit comments