summaryrefslogtreecommitdiffstats
path: root/tests/unittests/command_parse/test_script.py
blob: 3b984c3f9abbd704e79e97c65204ecd8142f7491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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"})