Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Unified Diff: service/datastore/serialize/serialize_test.go

Issue 1550903002: impl/memory: Fix time serialization encoding. (Closed) Base URL: https://github.com/luci/gae@master
Patch Set: Comments, tune-up. Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « service/datastore/serialize/serialize.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/serialize/serialize_test.go
diff --git a/service/datastore/serialize/serialize_test.go b/service/datastore/serialize/serialize_test.go
index 3dd7127c1c039f2853f434ac9309543fbb1fe42a..885bd7d2eba734f527bcdc3278838e249029f660 100644
--- a/service/datastore/serialize/serialize_test.go
+++ b/service/datastore/serialize/serialize_test.go
@@ -52,6 +52,7 @@ func ShouldEqualKey(actual interface{}, expected ...interface{}) string {
func TestPropertyMapSerialization(t *testing.T) {
t.Parallel()
+ now := time.Now().UTC()
tests := []dspmapTC{
{
"basic",
@@ -84,8 +85,9 @@ func TestPropertyMapSerialization(t *testing.T) {
"time",
ds.PropertyMap{
"T": {
- mp(time.Now().UTC()),
- mp(time.Now().Add(time.Second).UTC())},
+ mp(now),
+ mp(now.Add(time.Second)),
+ },
},
},
{
@@ -190,12 +192,7 @@ func TestSerializationReadMisc(t *testing.T) {
So(WriteTime(buf, time.Time{}), ShouldBeNil)
t, err := ReadTime(mkBuf(buf.Bytes()))
So(err, ShouldBeNil)
- So(t, ShouldResemble, time.Time{})
- })
-
- Convey("Bad ToBytes", func() {
- So(func() { ToBytes(100.7) }, ShouldPanic)
- So(func() { ToBytesWithContext(100.7) }, ShouldPanic)
+ So(t.Equal(time.Time{}), ShouldBeTrue)
})
Convey("ReadKey", func() {
« no previous file with comments | « service/datastore/serialize/serialize.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698