Skip to content

Commit 7ccbd68

Browse files
authored
Qualify @__testing(warning:) usage in macro expansion with module name and enhance a related unit test (#1038)
A small enhancement to the `@Test` and `@Suite` macro expansion changes made in #880: qualify the `@__testing(warning:)` usage with the module name. I also took the opportunity to enhance a unit test related to `@__testing(semantics:)`. It already correctly checks the attribute module name if present, and this test simply validates that. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent 2c60dd6 commit 7ccbd68

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Sources/TestingMacros/Support/TestContentGeneration.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func makeTestContentRecordDecl(named name: TokenSyntax, in typeName: TypeSyntax?
8686
#elseif os(Windows)
8787
@_section(".sw5test$B")
8888
#else
89-
@__testing(warning: "Platform-specific implementation missing: test content section name unavailable")
89+
@Testing.__testing(warning: "Platform-specific implementation missing: test content section name unavailable")
9090
#endif
9191
@_used
9292
#endif

Tests/TestingMacrosTests/PragmaMacroTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct PragmaMacroTests {
2222
let node = """
2323
@Testing.__testing(semantics: "abc123")
2424
@__testing(semantics: "def456")
25+
@UnrelatedModule.__testing(semantics: "xyz789")
2526
let x = 0
2627
""" as DeclSyntax
2728
let nodeWithAttributes = try #require(node.asProtocol((any WithAttributesSyntax).self))

0 commit comments

Comments
 (0)