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 ObjCDataFormatterNSURL(ObjCDataFormatterTestCase): 16 17 @skipUnlessDarwin 18 def test_nsurl_with_run_command(self): 19 """Test formatters for NSURL.""" 20 self.appkit_tester_impl(self.nsurl_data_formatter_commands) 21 22 def nsurl_data_formatter_commands(self): 23 self.expect( 24 'frame variable cfurl_ref cfchildurl_ref cfgchildurl_ref', 25 substrs=[ 26 '(CFURLRef) cfurl_ref = ', '@"http://www.foo.bar', 27 'cfchildurl_ref = ', '@"page.html -- http://www.foo.bar', 28 '(CFURLRef) cfgchildurl_ref = ', 29 '@"?whatever -- http://www.foo.bar/page.html"' 30 ]) 31 32 self.expect( 33 'frame variable nsurl nsurl2 nsurl3', 34 substrs=[ 35 '(NSURL *) nsurl = ', '@"http://www.foo.bar', 36 '(NSURL *) nsurl2 =', '@"page.html -- http://www.foo.bar', 37 '(NSURL *) nsurl3 = ', 38 '@"?whatever -- http://www.foo.bar/page.html"' 39 ]) 40