1
0
Fork 0

Merging upstream version 1.12.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 17:09:15 +01:00
parent d6445459ac
commit 7865f9a813
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
20 changed files with 536 additions and 80 deletions

View file

@ -54,3 +54,27 @@ def test_command_with_key_in_quotes(judge_command):
judge_command(
'cluster keyslot "mykey "', {"command": "cluster keyslot", "key": '"mykey "'}
)
def test_timeout(token_should_match, token_should_not_match):
from iredis.redis_grammar import TIMEOUT
token_should_match(TIMEOUT, "1.1")
token_should_match(TIMEOUT, "1.0")
token_should_match(TIMEOUT, ".1")
token_should_match(TIMEOUT, "123123.1123")
token_should_not_match(TIMEOUT, "1.")
token_should_not_match(TIMEOUT, ".")
token_should_not_match(TIMEOUT, ".a")
def test_lr_const(token_should_match, token_should_not_match):
from iredis.redis_grammar import LR_CONST
token_should_match(LR_CONST, "left")
token_should_match(LR_CONST, "right")
token_should_match(LR_CONST, "LEFT")
token_should_match(LR_CONST, "RIGHT")
token_should_not_match(LR_CONST, "righ")
token_should_not_match(LR_CONST, "ab")
token_should_not_match(LR_CONST, "123")