File tree 1 file changed +6
-5
lines changed 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,6 @@ func TestDurationWithJitter_ZeroInputDuration(t *testing.T) {
40
40
}
41
41
42
42
func TestParseTime (t * testing.T ) {
43
- ts , err := time .Parse (time .RFC3339Nano , "2015-06-03T13:21:58.555Z" )
44
- require .NoError (t , err )
45
-
46
43
var tests = []struct {
47
44
input string
48
45
fail bool
@@ -65,10 +62,14 @@ func TestParseTime(t *testing.T) {
65
62
result : time .Unix (123 , 123000000 ),
66
63
}, {
67
64
input : "2015-06-03T13:21:58.555Z" ,
68
- result : ts ,
65
+ result : time . Unix ( 1433337718 , 555 * time . Millisecond . Nanoseconds ()) ,
69
66
}, {
70
67
input : "2015-06-03T14:21:58.555+01:00" ,
71
- result : ts ,
68
+ result : time .Unix (1433337718 , 555 * time .Millisecond .Nanoseconds ()),
69
+ }, {
70
+ // Test nanosecond rounding.
71
+ input : "2015-06-03T13:21:58.56789Z" ,
72
+ result : time .Unix (1433337718 , 567 * 1e6 ),
72
73
}, {
73
74
// Test float rounding.
74
75
input : "1543578564.705" ,
You can’t perform that action at this time.
0 commit comments