execute a Do(args[,-1]...), which result needs to Contain() the same as the last arg.
(tb testing.TB, c *proto.Client, args ...string)
| 127 | |
| 128 | // execute a Do(args[,-1]...), which result needs to Contain() the same as the last arg. |
| 129 | func mustContain(tb testing.TB, c *proto.Client, args ...string) { |
| 130 | tb.Helper() |
| 131 | args, want := args[:len(args)-1], args[len(args)-1] |
| 132 | |
| 133 | res, err := c.Do(args...) |
| 134 | ok(tb, err) |
| 135 | if !strings.Contains(res, want) { |
| 136 | tb.Errorf("expected %q in %q", want, res) |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /*func useRESP3(t *testing.T, c *proto.Client) { |
| 141 | mustContain(t, c, "HELLO", "3", "miniredis") |