test(extgen): tighten parser tests by asserting warnings and dropping misleading conditionals#2381
Merged
alexandre-daubois merged 1 commit intoMay 12, 2026
Conversation
d2a33fe to
117a9b8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens internal/extgen parser tests by replacing conditional assertions with per-test assert callbacks, adding explicit coverage for invalid/orphan directives, and ensuring warnings are asserted when parsers intentionally emit them. It also makes integration tests skip (instead of fail) when external dependencies (PHP sources, xcaddy, php-config) are not available.
Changes:
- Refactor parser table tests (func/const/class) to use
expect+ optionalassertcallbacks, removing name-based conditional assertions. - Add func parser tests for invalid signatures being dropped and orphan
//export_php:functiondirectives surfacing as errors. - Capture and assert parser warnings in tests, and switch integration prereq failures to
t.Skip.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/extgen/integration_test.go | Skip integration tests when required external tools/files are missing (instead of failing). |
| internal/extgen/helpers_test.go | Add captureStdout helper for warning assertions (needs robustness fixes). |
| internal/extgen/funcparser_test.go | Tighten func parser assertions; add new directive/signature tests; assert warning output. |
| internal/extgen/constparser_test.go | Tighten constant parser assertions via callbacks; simplify error test expectations. |
| internal/extgen/classparser_test.go | Tighten class parser assertions via callbacks; remove misleading conditionals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
03317df to
2b125ff
Compare
… misleading conditionals
2b125ff to
88dd4b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.