Commit 7: Add Consistency.ql regression guard

New cpp/ql/test/library-tests/regex/Consistency.ql selects, for each
corpus RegExp, characters that failedToParse. The empty
Consistency.expected asserts that no corpus regex has any unparsed
character, mirroring PR #22200's Consistency test as the primary
regression guard for the parser.

Bundle: github/codeql-action codeql-bundle-v2.26.1 (CodeQL CLI 2.26.1).
This commit is contained in:
copilot-swe-agent[bot]
2026-07-21 12:26:05 +00:00
committed by GitHub
parent bfb7b1d046
commit 633ba01b77
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
/**
* Regression guard: every corpus regex must parse without leaving any
* character unaccounted for. Expected output is empty.
*/
import cpp
import semmle.code.cpp.regex.internal.ParseRegExp
from RegExp re, int i
where re.failedToParse(i)
select re, i, re.getChar(i)