Compare times in the same timezone

This commit is contained in:
Kamil Dziedzic
2017-08-21 20:10:45 +02:00
parent de1f123b2c
commit 3f06ea8fdf
2 changed files with 6 additions and 3 deletions

View File

@@ -317,6 +317,8 @@ func TestCalcTotalStats(t *testing.T) {
if err != nil && !tutil.ShouldUpdateSamples() {
t.Fatalf("cannot load expected results: %s", err.Error())
}
want.FirstSeen = want.FirstSeen.UTC()
want.LastSeen = want.LastSeen.UTC()
iter := pmgomock.NewMockIterManager(ctrl)
gomock.InOrder(
@@ -347,6 +349,8 @@ func TestCalcTotalStats(t *testing.T) {
fmt.Printf("cannot update samples: %s", err.Error())
}
}
s.FirstSeen = s.FirstSeen.UTC()
s.LastSeen = s.LastSeen.UTC()
if !reflect.DeepEqual(s, want) {
t.Errorf("Invalid stats.\nGot:%#v\nWant: %#v\n", s, want)
}