-
Notifications
You must be signed in to change notification settings - Fork 451
assertMacroExpansion should assert if there are errors #1758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci please test |
let expandedSourceFile = origSourceFile.expand(macros: macros, in: context) | ||
let formattedSourceFile = expandedSourceFile.formatted(using: BasicFormat(indentationWidth: indentationWidth)) | ||
|
||
XCTAssertFalse(expandedSourceFile.hasError, "Expanded source should not contain any syntax errors") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about running ParseDiagnsoticGenerator
to actually show the syntax errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable. I also considered showing the debug description but that seemed a bit much. This seems like a better idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this but IMO they still don't make much sense without the syntax tree. So I added that in as well.
e5ff9c1
to
41c0078
Compare
@swift-ci please test |
Invalid macro expansions should generate an assertion in `assertMacroExpansion` rather than being ignored.
41c0078
to
ea2d7e4
Compare
@swift-ci please test |
@swift-ci Please test Windows |
Invalid macro expansions should generate an assertion in
assertMacroExpansion
rather than being ignored.