Skip to content

Commit

Permalink
fix build on tip; time.Time representation has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
philhofer committed May 10, 2017
1 parent 5ebe43d commit 30738c1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions msgp/read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ func TestReadIntf(t *testing.T) {
if err != nil {
t.Errorf("Test case: %d: %s", i, err)
}
if !reflect.DeepEqual(v, ts) {

/* for time, use time.Equal instead of reflect.DeepEqual */
if tm, ok := v.(time.Time); ok && !tm.Equal(v.(time.Time)) {
t.Errorf("%v != %v", ts, v)
} else if !reflect.DeepEqual(v, ts) {
t.Errorf("%v in; %v out", ts, v)
}
}
Expand Down Expand Up @@ -633,11 +637,6 @@ func TestTime(t *testing.T) {
if !now.Equal(out) {
t.Fatalf("%s in; %s out", now, out)
}

// check for time.Local zone
if now != out {
t.Error("returned time.Time not set to time.Local")
}
}

func BenchmarkReadTime(b *testing.B) {
Expand Down

0 comments on commit 30738c1

Please sign in to comment.