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