Shared: Adjust semantics of optional inline expectation tags#21772
Open
hvitved wants to merge 1 commit intogithub:mainfrom
Open
Shared: Adjust semantics of optional inline expectation tags#21772hvitved wants to merge 1 commit intogithub:mainfrom
hvitved wants to merge 1 commit intogithub:mainfrom
Conversation
7429434 to
79baaad
Compare
Contributor
Author
Rerun has been triggered: 9 restarted 🚀 |
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the inline-expectations test harness so that “optional tag” annotations on expectations are no longer ignored, and are instead validated against actual results (while keeping the optionality asymmetric for results).
Changes:
- Treat expectation comments with optional tags as requiring a matching actual result.
- Introduce an
ignoreTaghook to allow tests to explicitly ignore expectations for certain tags.
Show a summary per file
| File | Description |
|---|---|
| shared/util/codeql/util/test/InlineExpectationsTest.qll | Updates optional-tag semantics, adds an ignore-tag hook, and updates related documentation/comments. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
Comment on lines
+150
to
+154
| * Holds if expectations marked with `expectedTag` are optional. | ||
| * | ||
| * An expectation with an optional tag acts as a normal expectation, meaning that there | ||
| * must be a matching result. In contrast, a result with an optional tag does not require | ||
| * a matching expectation. |
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.
Before this PR, inline expectation comments with optional tags were simply ignored, which is most likely not what was intended.
With this PR, inline expectation comments with optional tags are instead checked, meaning there must be an accompanying actual result. The converse, however, is not checked (which is what makes the comment optional).