xref: /llvm-project/lldb/test/API/commands/command/invalid-args/TestInvalidArgsCommand.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
199451b44SJordan Rupprechtimport lldb
299451b44SJordan Rupprechtfrom lldbsuite.test.lldbtest import *
399451b44SJordan Rupprechtfrom lldbsuite.test.decorators import *
499451b44SJordan Rupprecht
599451b44SJordan Rupprecht
6*2238dcc3SJonas Devlieghereclass InvalidArgsCommandTestCase(TestBase):
799451b44SJordan Rupprecht    @no_debug_info_test
899451b44SJordan Rupprecht    def test_script_add(self):
9*2238dcc3SJonas Devlieghere        self.expect(
10*2238dcc3SJonas Devlieghere            "command script add 1 2",
11*2238dcc3SJonas Devlieghere            error=True,
12*2238dcc3SJonas Devlieghere            substrs=["Path component: '1' not found"],
13*2238dcc3SJonas Devlieghere        )
1499451b44SJordan Rupprecht
15*2238dcc3SJonas Devlieghere        self.expect(
16*2238dcc3SJonas Devlieghere            "command script add",
17*2238dcc3SJonas Devlieghere            error=True,
18*2238dcc3SJonas Devlieghere            substrs=["'command script add' requires at least one argument"],
19*2238dcc3SJonas Devlieghere        )
2099451b44SJordan Rupprecht
2199451b44SJordan Rupprecht    @no_debug_info_test
2299451b44SJordan Rupprecht    def test_script_clear(self):
23*2238dcc3SJonas Devlieghere        self.expect(
24*2238dcc3SJonas Devlieghere            "command script clear f",
25*2238dcc3SJonas Devlieghere            error=True,
26*2238dcc3SJonas Devlieghere            substrs=["'command script clear' doesn't take any arguments"],
27*2238dcc3SJonas Devlieghere        )
2899451b44SJordan Rupprecht
2999451b44SJordan Rupprecht    @no_debug_info_test
3099451b44SJordan Rupprecht    def test_script_list(self):
31*2238dcc3SJonas Devlieghere        self.expect(
32*2238dcc3SJonas Devlieghere            "command script list f",
33*2238dcc3SJonas Devlieghere            error=True,
34*2238dcc3SJonas Devlieghere            substrs=["'command script list' doesn't take any arguments"],
35*2238dcc3SJonas Devlieghere        )
3699451b44SJordan Rupprecht
3799451b44SJordan Rupprecht    @no_debug_info_test
3899451b44SJordan Rupprecht    def test_script_import(self):
39*2238dcc3SJonas Devlieghere        self.expect(
40*2238dcc3SJonas Devlieghere            "command script import",
41*2238dcc3SJonas Devlieghere            error=True,
42*2238dcc3SJonas Devlieghere            substrs=["command script import needs one or more arguments"],
43*2238dcc3SJonas Devlieghere        )
4499451b44SJordan Rupprecht
4599451b44SJordan Rupprecht    @no_debug_info_test
4699451b44SJordan Rupprecht    def test_alias(self):
47*2238dcc3SJonas Devlieghere        self.expect(
48*2238dcc3SJonas Devlieghere            "command alias",
49*2238dcc3SJonas Devlieghere            error=True,
50*2238dcc3SJonas Devlieghere            substrs=["'command alias' requires at least two arguments"],
51*2238dcc3SJonas Devlieghere        )
5299451b44SJordan Rupprecht
53*2238dcc3SJonas Devlieghere        self.expect(
54*2238dcc3SJonas Devlieghere            "command alias blub foo",
55*2238dcc3SJonas Devlieghere            error=True,
56*2238dcc3SJonas Devlieghere            substrs=[
57*2238dcc3SJonas Devlieghere                "error: invalid command given to 'command alias'. 'foo' does not begin with a valid command.  No alias created."
58*2238dcc3SJonas Devlieghere            ],
59*2238dcc3SJonas Devlieghere        )
6099451b44SJordan Rupprecht
6199451b44SJordan Rupprecht    @no_debug_info_test
6299451b44SJordan Rupprecht    def test_unalias(self):
63*2238dcc3SJonas Devlieghere        self.expect(
64*2238dcc3SJonas Devlieghere            "command unalias",
65*2238dcc3SJonas Devlieghere            error=True,
66*2238dcc3SJonas Devlieghere            substrs=["must call 'unalias' with a valid alias"],
67*2238dcc3SJonas Devlieghere        )
6899451b44SJordan Rupprecht
6999451b44SJordan Rupprecht    @no_debug_info_test
7099451b44SJordan Rupprecht    def test_delete(self):
71*2238dcc3SJonas Devlieghere        self.expect(
72*2238dcc3SJonas Devlieghere            "command delete",
73*2238dcc3SJonas Devlieghere            error=True,
74*2238dcc3SJonas Devlieghere            substrs=["must call 'command delete' with one or more valid user"],
75*2238dcc3SJonas Devlieghere        )
7699451b44SJordan Rupprecht
7799451b44SJordan Rupprecht    @no_debug_info_test
7899451b44SJordan Rupprecht    def test_regex(self):
79*2238dcc3SJonas Devlieghere        self.expect(
80*2238dcc3SJonas Devlieghere            "command regex",
81*2238dcc3SJonas Devlieghere            error=True,
82*2238dcc3SJonas Devlieghere            substrs=["usage: 'command regex <command-name> "],
83*2238dcc3SJonas Devlieghere        )
8499451b44SJordan Rupprecht
8599451b44SJordan Rupprecht    @no_debug_info_test
8699451b44SJordan Rupprecht    def test_source(self):
87*2238dcc3SJonas Devlieghere        self.expect(
88*2238dcc3SJonas Devlieghere            "command source",
89*2238dcc3SJonas Devlieghere            error=True,
90*2238dcc3SJonas Devlieghere            substrs=[
91*2238dcc3SJonas Devlieghere                "'command source' takes exactly one executable filename argument."
92*2238dcc3SJonas Devlieghere            ],
93*2238dcc3SJonas Devlieghere        )
94