File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed
lldb/test/API/lang/swift/variables/error_type Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 99# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010#
1111# ------------------------------------------------------------------------------
12- import lldbsuite .test .lldbinline as lldbinline
12+ import lldb
13+ from lldbsuite .test .lldbtest import *
1314from lldbsuite .test .decorators import *
15+ import lldbsuite .test .lldbutil as lldbutil
16+
17+ class TestSwiftErrorType (TestBase ):
18+ @swiftTest
19+ def test (self ):
20+ """Test handling of Swift Error types"""
21+ self .build ()
22+ lldbutil .run_to_source_breakpoint (
23+ self , 'break here' , lldb .SBFileSpec ('main.swift' ))
24+ self .expect ('frame variable -d run -- s' , substrs = ['SError' ,'payload = 1' ])
25+ self .expect ('frame variable -d run -- c' , substrs = ['CError' ,'payload = 2' ])
26+ self .expect ('frame variable -d run -- e' , substrs = ['EError' ,'OutOfCookies' ])
27+ self .expect ('expr -d run -- s' , substrs = ['SError' ,'payload = 1' ])
28+ self .expect ('expr -d run -- c' , substrs = ['CError' ,'payload = 2' ])
29+ self .expect ('expr -d run -- e' , substrs = ['EError' ,'OutOfCookies' ])
1430
15- lldbinline .MakeInlineTest (__file__ , globals (), decorators = [swiftTest ])
Original file line number Diff line number Diff line change @@ -42,13 +42,7 @@ func main() {
4242 var c : Error = CError ( )
4343 var e : Error = EError . OutOfCookies
4444
45- print ( " break here " ) //% self.expect('frame variable -d run -- s', substrs=['SError','payload = 1'])
46- print ( " break here " ) //% self.expect('frame variable -d run -- c', substrs=['CError','payload = 2'])
47- print ( " break here " ) //% self.expect('frame variable -d run -- e', substrs=['EError','OutOfCookies'])
48-
49- print ( " break here " ) //% self.expect('expr -d run -- s', substrs=['SError','payload = 1'])
50- print ( " break here " ) //% self.expect('expr -d run -- c', substrs=['CError','payload = 2'])
51- print ( " break here " ) //% self.expect('expr -d run -- e', substrs=['EError','OutOfCookies'])
45+ print ( " break here " )
5246}
5347
5448main ( )
You can’t perform that action at this time.
0 commit comments