Index: impl/prod/everything_test.go |
diff --git a/impl/prod/everything_test.go b/impl/prod/everything_test.go |
index 9f2eb2fd1fe887f517b92069f12e400566cef698..d94a7ecb572dec15ea395032fc847d2e61fc2b61 100644 |
--- a/impl/prod/everything_test.go |
+++ b/impl/prod/everything_test.go |
@@ -13,6 +13,7 @@ import ( |
"github.com/luci/gae/service/blobstore" |
"github.com/luci/gae/service/datastore" |
"github.com/luci/gae/service/info" |
+ "github.com/luci/gae/service/memcache" |
"github.com/luci/luci-go/common/logging" |
. "github.com/smartystreets/goconvey/convey" |
"golang.org/x/net/context" |
@@ -52,6 +53,7 @@ func TestBasicDatastore(t *testing.T) { |
ctx := Use(context.Background(), req) |
ds := datastore.Get(ctx) |
+ mc := memcache.Get(ctx) |
inf := info.Get(ctx) |
// You have to visually confirm that this actually happens in the stdout |
@@ -214,5 +216,13 @@ func TestBasicDatastore(t *testing.T) { |
So(ds.Get(&ent), ShouldBeNil) |
So(ent["Time"], ShouldResemble, pm["Time"]) |
}) |
+ |
+ Convey("memcache: Set (nil) is the same as Set ([]byte{})", func() { |
+ So(mc.Set(mc.NewItem("bob")), ShouldBeNil) // normally would panic because Value is nil |
+ |
+ bob, err := mc.Get("bob") |
+ So(err, ShouldBeNil) |
+ So(bob.Value(), ShouldResemble, []byte{}) |
+ }) |
}) |
} |