diff --git a/Sources/IssueReportingTestSupport/SwiftTesting.swift b/Sources/IssueReportingTestSupport/SwiftTesting.swift index 0107ed4..7ca6b94 100644 --- a/Sources/IssueReportingTestSupport/SwiftTesting.swift +++ b/Sources/IssueReportingTestSupport/SwiftTesting.swift @@ -14,6 +14,7 @@ private func __recordIssue( column: Int ) { #if canImport(Testing) + let message = message == "" ? nil : message Issue.record( message.map(Comment.init(rawValue:)), sourceLocation: SourceLocation( diff --git a/Tests/IssueReportingTests/SwiftTestingTests.swift b/Tests/IssueReportingTests/SwiftTestingTests.swift index 3969ac6..68a3f09 100644 --- a/Tests/IssueReportingTests/SwiftTestingTests.swift +++ b/Tests/IssueReportingTests/SwiftTestingTests.swift @@ -129,6 +129,36 @@ && issue.description == "Issue recorded: Something went wrong" } } + + @Test + func emptyMessage() { + withKnownIssue { + reportIssue("") + } + } + + @Test + func emptyMessage_async() async { + await withKnownIssue { + await Task.yield() + reportIssue("") + } + } + + @Test + func emptyMessage_throws() throws { + withKnownIssue { + reportIssue("") + } + } + + @Test + func emptyMessage_asyncThrows() async throws { + await withKnownIssue { + await Task.yield() + reportIssue("") + } + } } private struct Failure: Error {}