lib/db: Fix test for Go 1.9's smarter time.Time values

This commit is contained in:
Jakob Borg 2017-06-28 14:35:56 +02:00
parent 6503326073
commit add10c98fa

View File

@ -51,14 +51,14 @@ func TestNamespacedTime(t *testing.T) {
n1 := NewNamespacedKV(ldb, "foo")
if v, ok := n1.Time("test"); v != (time.Time{}) || ok {
if v, ok := n1.Time("test"); !v.IsZero() || ok {
t.Errorf("Incorrect return v %v != %v || ok %v != false", v, time.Time{}, ok)
}
now := time.Now()
n1.PutTime("test", now)
if v, ok := n1.Time("test"); v != now || !ok {
if v, ok := n1.Time("test"); !v.Equal(now) || !ok {
t.Errorf("Incorrect return v %v != %v || ok %v != true", v, now, ok)
}
}