Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ let package = Package(
"IssueReportingTestSupport",
]
),
.testTarget(
name: "IssueReportingTestsNoSupport",
dependencies: [
"IssueReporting",
]
),
.target(
name: "IssueReportingTestSupport",
dependencies: [
Expand Down
6 changes: 6 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ let package = Package(
"IssueReportingTestSupport",
]
),
.testTarget(
name: "IssueReportingTestsNoSupport",
dependencies: [
"IssueReporting",
]
),
.target(
name: "IssueReportingTestSupport",
dependencies: [
Expand Down
18 changes: 16 additions & 2 deletions Tests/IssueReporting.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@

},
"testTargets" : [
{
"target" : {
"containerPath" : "container:Examples\/Examples.xcodeproj",
"identifier" : "CADE79BA2C4A9D2D005A85F7",
"name" : "ExamplesTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "XCTestDynamicOverlayTests",
"name" : "XCTestDynamicOverlayTests"
}
},
{
"target" : {
"containerPath" : "container:",
Expand All @@ -22,8 +36,8 @@
{
"target" : {
"containerPath" : "container:",
"identifier" : "XCTestDynamicOverlayTests",
"name" : "XCTestDynamicOverlayTests"
"identifier" : "IssueReportingTestsNoSupport",
"name" : "IssueReportingTestsNoSupport"
}
}
],
Expand Down
49 changes: 49 additions & 0 deletions Tests/IssueReportingTestsNoSupport/WithExpectedIssueTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import IssueReporting
import Testing

@Suite struct WithExpectedIssueTests {
@Test func sync() {
withExpectedIssue {
reportIssue()
}
}

@Test func syncThrows() throws {
withExpectedIssue {
reportIssue()
throw SomeError()
}
}

@Test func asyncAwaitBefore() async {
await withExpectedIssue {
await Task.yield()
reportIssue()
}
}

@Test func asyncAwaitAfter() async {
await withExpectedIssue {
reportIssue()
await Task.yield()
}
}

@Test func asyncAwaitBeforeThrows() async throws {
await withExpectedIssue {
await Task.yield()
reportIssue()
throw SomeError()
}
}

@Test func asyncAwaitAfterThrows() async throws {
await withExpectedIssue {
reportIssue()
await Task.yield()
throw SomeError()
}
}
}

private struct SomeError: Error {}
Loading