1"""
2Test more expression command sequences with objective-c.
3"""
4
5
6
7import lldb
8from lldbsuite.test.decorators import *
9from lldbsuite.test.lldbtest import *
10from lldbsuite.test import lldbutil
11
12
13class FoundationTestCaseNSArray(TestBase):
14
15    mydir = TestBase.compute_mydir(__file__)
16
17    def test_NSArray_expr_commands(self):
18        """Test expression commands for NSArray."""
19        self.build()
20        self.target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
21                self, '// Break here for NSArray tests',
22                lldb.SBFileSpec('main.m', False))
23
24        self.runCmd("thread backtrace")
25        self.expect("expression (int)[nil_mutable_array count]",
26                    patterns=["\(int\) \$.* = 0"])
27        self.expect("expression (int)[array1 count]",
28                    patterns=["\(int\) \$.* = 3"])
29        self.expect("expression (int)[array2 count]",
30                    patterns=["\(int\) \$.* = 3"])
31        self.expect("expression (int)array1.count",
32                    patterns=["\(int\) \$.* = 3"])
33        self.expect("expression (int)array2.count",
34                    patterns=["\(int\) \$.* = 3"])
35        self.runCmd("process continue")
36