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

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: Support PTBytes type, found the "ForIndex" method. Created 5 years 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
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..acaec3fd9977edb55ffe804485b17c6dee08a610 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)),
+ },
},
},
{
@@ -193,11 +195,6 @@ func TestSerializationReadMisc(t *testing.T) {
So(t, ShouldResemble, time.Time{})
})
- Convey("Bad ToBytes", func() {
- So(func() { ToBytes(100.7) }, ShouldPanic)
- So(func() { ToBytesWithContext(100.7) }, ShouldPanic)
- })
-
Convey("ReadKey", func() {
Convey("good cases", func() {
Convey("w/ ctx decodes normally w/ ctx", func() {
« service/datastore/serialize/serialize.go ('K') | « service/datastore/serialize/serialize.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698