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 9
9
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
10
#
11
11
# ------------------------------------------------------------------------------
12
- import lldbsuite .test .lldbinline as lldbinline
12
+ import lldb
13
+ from lldbsuite .test .lldbtest import *
13
14
from 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' ])
14
30
15
- lldbinline .MakeInlineTest (__file__ , globals (), decorators = [swiftTest ])
Original file line number Diff line number Diff line change @@ -42,13 +42,7 @@ func main() {
42
42
var c : Error = CError ( )
43
43
var e : Error = EError . OutOfCookies
44
44
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 " )
52
46
}
53
47
54
48
main ( )
You can’t perform that action at this time.
0 commit comments