MCPcopy Create free account
hub / github.com/cloud-native-go/examples / TestDelete

Function TestDelete

ch08/grpc/keyvalue_server/core_test.go:85–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

83}
84
85func TestDelete(t *testing.T) {
86 const key = "delete-key"
87 const value = "delete-value"
88
89 var contains bool
90
91 defer delete(store.m, key)
92
93 store.m[key] = value
94
95 _, contains = store.m[key]
96 if !contains {
97 t.Error("key/value doesn't exist")
98 }
99
100 Delete(key)
101
102 _, contains = store.m[key]
103 if contains {
104 t.Error("Delete failed")
105 }
106}

Callers

nothing calls this directly

Calls 1

DeleteFunction · 0.70

Tested by

no test coverage detected