test set px|ex|未知
(t *testing.T)
| 201 | |
| 202 | // test set px|ex|未知 |
| 203 | func 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|未知 |
| 230 | func TestStringSetThree(t *testing.T) { |