df380aefd88f4f7f855c3c5855f735031fed5c71
[openbsd] /
1 # encoding: utf-8
2 """
3 Test lldb data formatter subsystem.
4 """
5
6
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
11
12 from ObjCDataFormatterTestCase import ObjCDataFormatterTestCase
13
14
15 class ObjCDataFormatterNSError(ObjCDataFormatterTestCase):
16
17     @skipUnlessDarwin
18     def test_nserror_with_run_command(self):
19         """Test formatters for NSError."""
20         self.appkit_tester_impl(self.nserror_data_formatter_commands)
21
22     def nserror_data_formatter_commands(self):
23         self.expect(
24             'frame variable nserror', substrs=['domain: @"Foobar" - code: 12'])
25
26         self.expect(
27             'frame variable nserrorptr',
28             substrs=['domain: @"Foobar" - code: 12'])
29
30         self.expect(
31             'frame variable nserror->_userInfo', substrs=['2 key/value pairs'])
32
33         self.expect(
34             'frame variable nserror->_userInfo --ptr-depth 1 -d run-target',
35             substrs=['@"a"', '@"b"', "1", "2"])