diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 17:38:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 17:38:04 +0000 |
commit | e0847dd62461001851da4c89f279e16b14c3eb4c (patch) | |
tree | 87422376dd9a7eee55850f0fce9a8bb4c13e44a2 /tests/unittests/command_parse/test_script.py | |
parent | Initial commit. (diff) | |
download | iredis-e0847dd62461001851da4c89f279e16b14c3eb4c.tar.xz iredis-e0847dd62461001851da4c89f279e16b14c3eb4c.zip |
Adding upstream version 1.13.0.upstream/1.13.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/unittests/command_parse/test_script.py')
-rw-r--r-- | tests/unittests/command_parse/test_script.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unittests/command_parse/test_script.py b/tests/unittests/command_parse/test_script.py new file mode 100644 index 0000000..3b984c3 --- /dev/null +++ b/tests/unittests/command_parse/test_script.py @@ -0,0 +1,22 @@ +def test_eval(judge_command): + judge_command( + 'eval "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" 2 key1 key2 first second', + { + "command": "eval", + "double_lua": "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", + "any": "2 key1 key2 first second", + }, + ) + judge_command( + "eval 'return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}' 2 key1 key2 first second", + { + "command": "eval", + "single_lua": "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", + "any": "2 key1 key2 first second", + }, + ) + + +def test_scriptdebug(judge_command): + judge_command("SCRIPT DEBUG YES", {"command": "SCRIPT DEBUG", "scriptdebug": "YES"}) + judge_command("SCRIPT DEBUG no", {"command": "SCRIPT DEBUG", "scriptdebug": "no"}) |