File tree Expand file tree Collapse file tree 4 files changed +79
-2
lines changed
IssueReportingTestsNoSupport Expand file tree Collapse file tree 4 files changed +79
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ let package = Package(
37
37
" IssueReportingTestSupport " ,
38
38
]
39
39
) ,
40
+ . testTarget(
41
+ name: " IssueReportingTestsNoSupport " ,
42
+ dependencies: [
43
+ " IssueReporting " ,
44
+ ]
45
+ ) ,
40
46
. target(
41
47
name: " IssueReportingTestSupport " ,
42
48
dependencies: [
Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ let package = Package(
36
36
" IssueReportingTestSupport " ,
37
37
]
38
38
) ,
39
+ . testTarget(
40
+ name: " IssueReportingTestsNoSupport " ,
41
+ dependencies: [
42
+ " IssueReporting " ,
43
+ ]
44
+ ) ,
39
45
. target(
40
46
name: " IssueReportingTestSupport " ,
41
47
dependencies: [
Original file line number Diff line number Diff line change 12
12
13
13
},
14
14
"testTargets" : [
15
+ {
16
+ "target" : {
17
+ "containerPath" : "container:Examples\/Examples.xcodeproj",
18
+ "identifier" : "CADE79BA2C4A9D2D005A85F7",
19
+ "name" : "ExamplesTests"
20
+ }
21
+ },
22
+ {
23
+ "target" : {
24
+ "containerPath" : "container:",
25
+ "identifier" : "XCTestDynamicOverlayTests",
26
+ "name" : "XCTestDynamicOverlayTests"
27
+ }
28
+ },
15
29
{
16
30
"target" : {
17
31
"containerPath" : "container:",
22
36
{
23
37
"target" : {
24
38
"containerPath" : "container:",
25
- "identifier" : "XCTestDynamicOverlayTests ",
26
- "name" : "XCTestDynamicOverlayTests "
39
+ "identifier" : "IssueReportingTestsNoSupport ",
40
+ "name" : "IssueReportingTestsNoSupport "
27
41
}
28
42
}
29
43
],
Original file line number Diff line number Diff line change
1
+ #if canImport(Testing)
2
+ import IssueReporting
3
+ import Testing
4
+
5
+ @Suite struct WithExpectedIssueTests {
6
+ @Test func sync( ) {
7
+ withExpectedIssue {
8
+ reportIssue ( )
9
+ }
10
+ }
11
+
12
+ @Test func syncThrows( ) throws {
13
+ withExpectedIssue {
14
+ reportIssue ( )
15
+ throw SomeError ( )
16
+ }
17
+ }
18
+
19
+ @Test func asyncAwaitBefore( ) async {
20
+ await withExpectedIssue {
21
+ await Task . yield ( )
22
+ reportIssue ( )
23
+ }
24
+ }
25
+
26
+ @Test func asyncAwaitAfter( ) async {
27
+ await withExpectedIssue {
28
+ reportIssue ( )
29
+ await Task . yield ( )
30
+ }
31
+ }
32
+
33
+ @Test func asyncAwaitBeforeThrows( ) async throws {
34
+ await withExpectedIssue {
35
+ await Task . yield ( )
36
+ reportIssue ( )
37
+ throw SomeError ( )
38
+ }
39
+ }
40
+
41
+ @Test func asyncAwaitAfterThrows( ) async throws {
42
+ await withExpectedIssue {
43
+ reportIssue ( )
44
+ await Task . yield ( )
45
+ throw SomeError ( )
46
+ }
47
+ }
48
+ }
49
+
50
+ private struct SomeError : Error { }
51
+ #endif
You can’t perform that action at this time.
0 commit comments