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    def test_NSArray_expr_commands(self):
16        """Test expression commands for NSArray."""
17        self.build()
18        self.target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
19                self, '// Break here for NSArray tests',
20                lldb.SBFileSpec('main.m', False))
21
22        self.runCmd("thread backtrace")
23        self.expect("expression (int)[nil_mutable_array count]",
24                    patterns=["\(int\) \$.* = 0"])
25        self.expect("expression (int)[array1 count]",
26                    patterns=["\(int\) \$.* = 3"])
27        self.expect("expression (int)[array2 count]",
28                    patterns=["\(int\) \$.* = 3"])
29        self.expect("expression (int)array1.count",
30                    patterns=["\(int\) \$.* = 3"])
31        self.expect("expression (int)array2.count",
32                    patterns=["\(int\) \$.* = 3"])
33        self.runCmd("process continue")
34