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

Unified Diff: impl/memory/memcache_test.go

Issue 1541183002: Make setting a Memcache Item with a nil Value OK (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: 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
« no previous file with comments | « no previous file | impl/prod/everything_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/memcache_test.go
diff --git a/impl/memory/memcache_test.go b/impl/memory/memcache_test.go
index bc2d0e5fed0df4e66b75d507b4e4cb4a0f57e4d6..98803676d15c13853ce0032938fb7ff8e4a6e4b7 100644
--- a/impl/memory/memcache_test.go
+++ b/impl/memory/memcache_test.go
@@ -107,6 +107,14 @@ func TestMemcache(t *testing.T) {
})
})
+ Convey("Set (nil) is equivalent to Set([]byte{})", func() {
+ So(mc.Set(mc.NewItem("bob")), ShouldBeNil)
+
+ bob, err := mc.Get("bob")
+ So(err, ShouldBeNil)
+ So(bob.Value(), ShouldResemble, []byte{})
+ })
+
Convey("Increment", func() {
val, err := mc.Increment("num", 7, 2)
So(err, ShouldBeNil)
« no previous file with comments | « no previous file | impl/prod/everything_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698