From 633ba01b772f3b2f8a6983fa24af84245ccadb95 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Jul 2026 12:26:05 +0000 Subject: [PATCH] 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). --- cpp/ql/test/library-tests/regex/Consistency.expected | 0 cpp/ql/test/library-tests/regex/Consistency.ql | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 cpp/ql/test/library-tests/regex/Consistency.expected create mode 100644 cpp/ql/test/library-tests/regex/Consistency.ql diff --git a/cpp/ql/test/library-tests/regex/Consistency.expected b/cpp/ql/test/library-tests/regex/Consistency.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cpp/ql/test/library-tests/regex/Consistency.ql b/cpp/ql/test/library-tests/regex/Consistency.ql new file mode 100644 index 00000000000..c99a56fb90b --- /dev/null +++ b/cpp/ql/test/library-tests/regex/Consistency.ql @@ -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)