xref: /llvm-project/lldb/test/API/commands/apropos/basic/TestApropos.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1import lldb
2from lldbsuite.test.lldbtest import *
3from lldbsuite.test.decorators import *
4
5
6class AproposTestCase(TestBase):
7    @no_debug_info_test
8    def test_apropos(self):
9        self.expect(
10            "apropos", error=True, substrs=[" must be called with exactly one argument"]
11        )
12        self.expect(
13            "apropos a b",
14            error=True,
15            substrs=[" must be called with exactly one argument"],
16        )
17        self.expect("apropos ''", error=True, substrs=["'' is not a valid search word"])
18
19    @no_debug_info_test
20    def test_apropos_variable(self):
21        """Test that 'apropos variable' prints the fully qualified command name"""
22        self.expect(
23            "apropos variable",
24            substrs=["frame variable", "target variable", "watchpoint set variable"],
25        )
26