(t *testing.T)
| 55 | } |
| 56 | |
| 57 | func TestProtocol_ParsePutCommand_PX(t *testing.T) { |
| 58 | putCmd := NewPut("my-dmap", "my-key", []byte("my-value")) |
| 59 | putCmd.SetPX((100 * time.Millisecond).Milliseconds()) |
| 60 | |
| 61 | cmd := stringToCommand(putCmd.Command(context.Background()).String()) |
| 62 | parsed, err := ParsePutCommand(cmd) |
| 63 | require.NoError(t, err) |
| 64 | |
| 65 | require.Equal(t, "my-dmap", parsed.DMap) |
| 66 | require.Equal(t, "my-key", parsed.Key) |
| 67 | require.Equal(t, []byte("my-value"), parsed.Value) |
| 68 | require.Equal(t, int64(100), parsed.PX) |
| 69 | } |
| 70 | |
| 71 | func TestProtocol_ParsePutCommand_NX(t *testing.T) { |
| 72 | putCmd := NewPut("my-dmap", "my-key", []byte("my-value")) |
nothing calls this directly
no test coverage detected