(t *testing.T)
| 324 | } |
| 325 | |
| 326 | func TestStringSetRange(t *testing.T) { |
| 327 | args := make([]string, 3) |
| 328 | key := "setrange" |
| 329 | args[0] = key |
| 330 | args[1] = "3" |
| 331 | args[2] = value |
| 332 | |
| 333 | ctx := ContextTest("setrange", args...) |
| 334 | Call(ctx) |
| 335 | assert.Contains(t, ctxString(ctx.Out), "8") |
| 336 | ctx = ContextTest("get", key) |
| 337 | Call(ctx) |
| 338 | assert.Contains(t, ctxString(ctx.Out), value) |
| 339 | |
| 340 | args[1] = "1" |
| 341 | args[2] = "lll" |
| 342 | ctx = ContextTest("setrange", args...) |
| 343 | Call(ctx) |
| 344 | assert.Contains(t, ctxString(ctx.Out), "8") |
| 345 | ctx = ContextTest("get", key) |
| 346 | Call(ctx) |
| 347 | assert.Contains(t, ctxString(ctx.Out), "lllalue") |
| 348 | |
| 349 | args[1] = "10" |
| 350 | args[2] = value |
| 351 | ctx = ContextTest("setrange", args...) |
| 352 | Call(ctx) |
| 353 | assert.Contains(t, ctxString(ctx.Out), "15") |
| 354 | ctx = ContextTest("get", key) |
| 355 | Call(ctx) |
| 356 | assert.Contains(t, ctxString(ctx.Out), "\x00lllalue\x00\x00value") |
| 357 | |
| 358 | args[1] = "s" |
| 359 | ctx = ContextTest("setrange", args...) |
| 360 | Call(ctx) |
| 361 | assert.Contains(t, ctxString(ctx.Out), ErrInteger.Error()) |
| 362 | |
| 363 | args[1] = "-2" |
| 364 | ctx = ContextTest("setrange", args...) |
| 365 | Call(ctx) |
| 366 | assert.Contains(t, ctxString(ctx.Out), ErrMaximum.Error()) |
| 367 | } |
| 368 | func TestStringIncr(t *testing.T) { |
| 369 | args := make([]string, 1) |
| 370 | args[0] = "incr" |
nothing calls this directly
no test coverage detected