1"""
2Test the warnings that LLDB emits when parsing Objective-C expressions.
3"""
4
5import lldb
6from lldbsuite.test.decorators import *
7from lldbsuite.test.lldbtest import *
8from lldbsuite.test import lldbutil
9
10class TestCase(TestBase):
11
12    mydir = TestBase.compute_mydir(__file__)
13
14    @skipUnlessDarwin
15    @no_debug_info_test
16    def test(self):
17        self.build()
18        lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.m"))
19
20        # Don't warn about not using the result of getters. This is perfectly
21        # fine in the expression parser and LLDB shouldn't warn the user about that.
22        result = self.frame().EvaluateExpression("m.m; unknown_var_to_cause_an_error")
23        self.assertNotIn("getters should not", str(result.GetError()))
24