47d77b0e5696260bf61bee32d8e4ed9267951061
[openbsd] /
1 import lldb
2 from lldbsuite.test.lldbtest import *
3 from lldbsuite.test.decorators import *
4
5 class InvalidArgsCommandTestCase(TestBase):
6
7     mydir = TestBase.compute_mydir(__file__)
8
9     @no_debug_info_test
10     def test_script_add(self):
11         self.expect("command script add 1 2", error=True,
12                     substrs=["'command script add' requires one argument"])
13
14         self.expect("command script add", error=True,
15                     substrs=["'command script add' requires one argument"])
16
17     @no_debug_info_test
18     def test_script_clear(self):
19         self.expect("command script clear f", error=True,
20                     substrs=["'command script clear' doesn't take any arguments"])
21
22     @no_debug_info_test
23     def test_script_list(self):
24         self.expect("command script list f", error=True,
25                     substrs=["'command script list' doesn't take any arguments"])
26
27     @no_debug_info_test
28     def test_script_import(self):
29         self.expect("command script import", error=True,
30                     substrs=["command script import needs one or more arguments"])
31
32     @no_debug_info_test
33     def test_alias(self):
34         self.expect("command alias", error=True,
35                     substrs=["'command alias' requires at least two arguments"])
36
37         self.expect("command alias blub foo", error=True,
38                     substrs=["error: invalid command given to 'command alias'. 'foo' does not begin with a valid command.  No alias created."])
39
40     @no_debug_info_test
41     def test_unalias(self):
42         self.expect("command unalias", error=True,
43                     substrs=["must call 'unalias' with a valid alias"])
44
45     @no_debug_info_test
46     def test_delete(self):
47         self.expect("command delete", error=True,
48                     substrs=["must call 'command delete' with one or more valid user"])
49
50     @no_debug_info_test
51     def test_regex(self):
52         self.expect("command regex", error=True,
53                     substrs=["usage: 'command regex <command-name> "])
54
55     @no_debug_info_test
56     def test_source(self):
57         self.expect("command source", error=True,
58                     substrs=["'command source' takes exactly one executable filename argument."])