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

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

Issue 1334043003: Use int64 to store time.Time internally in memory implementation. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: remove debug panic Created 5 years, 3 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 0006bce4de096a69430f526fcab1fe43d64e1960..63f44d01b6b3b0b094cae2d2d1dce6ccfee405ae 100644
--- a/service/datastore/serialize/serialize_test.go
+++ b/service/datastore/serialize/serialize_test.go
@@ -174,6 +174,14 @@ func TestSerializationReadMisc(t *testing.T) {
So(string(ToBytes(tp.Value())), ShouldEqual, string(ToBytes(tp)[1:]))
})
+ Convey("Zero time", func() {
+ buf := mkBuf(nil)
+ So(WriteTime(buf, time.Time{}), ShouldBeNil)
+ t, err := ReadTime(mkBuf(buf.Bytes()))
+ So(err, ShouldBeNil)
+ So(t.IsZero(), ShouldBeTrue)
+ })
+
Convey("Bad ToBytes", func() {
So(func() { ToBytes(100.7) }, ShouldPanic)
So(func() { ToBytesWithContext(100.7) }, ShouldPanic)
« 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