1# encoding: utf-8
2"""
3Test lldb data formatter subsystem.
4"""
5
6
7import lldb
8from lldbsuite.test.decorators import *
9from lldbsuite.test.lldbtest import *
10from lldbsuite.test import lldbutil
11
12from ObjCDataFormatterTestCase import ObjCDataFormatterTestCase
13
14
15class ObjCDataFormatterNSException(ObjCDataFormatterTestCase):
16    def test_nsexception_with_run_command(self):
17        """Test formatters for NSException."""
18        self.appkit_tester_impl(self.nsexception_data_formatter_commands, True)
19
20    @skipUnlessDarwin
21    def test_nsexception_with_run_command_no_const(self):
22        """Test formatters for NSException."""
23        self.appkit_tester_impl(self.nsexception_data_formatter_commands, False)
24
25    def nsexception_data_formatter_commands(self):
26        self.expect(
27            "frame variable except0 except1 except2 except3",
28            substrs=[
29                "(NSException *) except0 = ",
30                '@"First"',
31                "(NSException *) except1 = ",
32                '@"Second"',
33                "(NSException *) except2 = ",
34                ' @"Third"',
35                "(NSException *) except3 = ",
36                ' @"Fourth"',
37            ],
38        )
39