test cases for add keepttl option for set.
@@ -57,6 +57,39 @@ def test_set(judge_command):
"SET abc bar XX",
{"command": "SET", "key": "abc", "value": "bar", "condition": "XX"},
)
+ # keepttl
+ judge_command(
+ "SET abc bar XX keepttl",
+ {
+ "command": "SET",
+ "key": "abc",
+ "value": "bar",
+ "condition": "XX",
+ "keepttl": "keepttl",
+ },
+ )
+ judge_command(
+ "SET abc bar keepttl XX",
+ {
+ "command": "SET",
+ "key": "abc",
+ "value": "bar",
+ "condition": "XX",
+ "keepttl": "keepttl",
+ },
+ )
+ judge_command(
+ "SET abc bar XX px 10000 KEEPTTL",
+ {
+ "command": "SET",
+ "key": "abc",
+ "value": "bar",
+ "expiration": "px",
+ "millisecond": "10000",
+ "condition": "XX",
+ "keepttl": "KEEPTTL",
+ },
+ )
def test_append(judge_command):
