diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-04 07:58:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-04 07:58:56 +0000 |
commit | a785d1c2de7d227674051b865935013bdd27e60f (patch) | |
tree | cf642e98373f0a1b8fbc5e772c30c334f2cd4d30 /tests/unittests/command_parse/test_base_token.py | |
parent | Adding upstream version 1.11.1. (diff) | |
download | iredis-a785d1c2de7d227674051b865935013bdd27e60f.tar.xz iredis-a785d1c2de7d227674051b865935013bdd27e60f.zip |
Adding upstream version 1.12.0.upstream/1.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/unittests/command_parse/test_base_token.py')
-rw-r--r-- | tests/unittests/command_parse/test_base_token.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/unittests/command_parse/test_base_token.py b/tests/unittests/command_parse/test_base_token.py index b04722e..545bc92 100644 --- a/tests/unittests/command_parse/test_base_token.py +++ b/tests/unittests/command_parse/test_base_token.py @@ -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") |