• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""Test that the Objective-C syntax for dictionary/array literals and indexing works"""
2
3
4import lldb
5from lldbsuite.test.decorators import *
6from lldbsuite.test.lldbtest import *
7from lldbsuite.test import lldbutil
8
9from ObjCNewSyntaxTest import ObjCNewSyntaxTest
10
11
12class ObjCNewSyntaxTestCaseDictionary(ObjCNewSyntaxTest):
13
14    @skipIf(macos_version=["<", "10.12"])
15    @expectedFailureAll(archs=["i[3-6]86"])
16    def test_read_dictionary(self):
17        self.runToBreakpoint()
18
19        self.expect(
20            "expr --object-description -- immutable_dictionary[@\"key\"]",
21            VARIABLES_DISPLAYED_CORRECTLY,
22            substrs=["value"])
23
24        self.expect(
25            "expr --object-description -- mutable_dictionary[@\"key\"]",
26            VARIABLES_DISPLAYED_CORRECTLY,
27            substrs=["value"])
28
29    @skipIf(macos_version=["<", "10.12"])
30    @expectedFailureAll(archs=["i[3-6]86"])
31    def test_update_dictionary(self):
32        self.runToBreakpoint()
33
34        self.expect(
35            "expr --object-description -- mutable_dictionary[@\"key\"] = @\"object\"",
36            VARIABLES_DISPLAYED_CORRECTLY,
37            substrs=["object"])
38
39        self.expect(
40            "expr --object-description -- mutable_dictionary[@\"key\"]",
41            VARIABLES_DISPLAYED_CORRECTLY,
42            substrs=["object"])
43
44    @skipIf(macos_version=["<", "10.12"])
45    @expectedFailureAll(archs=["i[3-6]86"])
46    def test_dictionary_literal(self):
47        self.runToBreakpoint()
48
49        self.expect(
50            "expr --object-description -- @{ @\"key\" : @\"object\" }",
51            VARIABLES_DISPLAYED_CORRECTLY,
52            substrs=[
53                "key",
54                "object"])
55