Skip to content

Commit 7ef7f1d

Browse files
authored
Add a minimal test for the PD macro API (#6399)
This should avoid regressions like the one introduced by #6356
1 parent 094bbb1 commit 7ef7f1d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Tests/PackageLoadingTests/PD_Next_LoadingTests.swift

+17
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,21 @@ class PackageDescriptionNextLoadingTests: PackageDescriptionLoadingTests {
3939
}
4040
}
4141
}
42+
43+
func testMacroTargets() throws {
44+
let content = """
45+
import CompilerPluginSupport
46+
import PackageDescription
47+
48+
let package = Package(name: "MyPackage",
49+
targets: [
50+
.macro(name: "MyMacro"),
51+
]
52+
)
53+
"""
54+
55+
let observability = ObservabilitySystem.makeForTesting()
56+
let (_, diagnostics) = try loadAndValidateManifest(content, observabilityScope: observability.topScope)
57+
XCTAssertEqual(diagnostics.count, 0, "unexpected diagnostics: \(diagnostics)")
58+
}
4259
}

0 commit comments

Comments
 (0)