MCPcopy Create free account
hub / github.com/distributedio/titan / TestStringSetFour

Function TestStringSetFour

command/strings_test.go:203–227  ·  view source on GitHub ↗

test set px|ex|未知

(t *testing.T)

Source from the content-addressed store, hash-verified

201
202// test set px|ex|未知
203func TestStringSetFour(t *testing.T) {
204 key := "setpxex"
205 args := SetFour(key)
206 ctx := ContextTest("set", args...)
207 Call(ctx)
208 assert.Contains(t, ctxString(ctx.Out), "OK")
209 EqualGet(t, key, value, nil)
210
211 args[2] = "ex"
212 ctx = ContextTest("set", args...)
213 Call(ctx)
214 assert.Contains(t, ctxString(ctx.Out), "OK")
215 EqualGet(t, key, value, nil)
216
217 args[3] = "x"
218 ctx = ContextTest("set", args...)
219 Call(ctx)
220 assert.Contains(t, ctxString(ctx.Out), ErrInteger.Error())
221
222 args[2] = "zx"
223
224 ctx = ContextTest("set", args...)
225 Call(ctx)
226 assert.Contains(t, ctxString(ctx.Out), ErrSyntax.Error())
227}
228
229// test set NX|XX|未知
230func TestStringSetThree(t *testing.T) {

Callers

nothing calls this directly

Calls 6

SetFourFunction · 0.85
ContextTestFunction · 0.85
CallFunction · 0.85
ctxStringFunction · 0.85
EqualGetFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected