Skip to content

fix(test-discovery): keep +, $ and ^ literal in globs, and match everything with ** - #249

Merged
adityankale190895 merged 2 commits into
DiffCI:mainfrom
FredApps:fix/glob-regex-literals
Nov 18, 2026
Merged

adityankale190895 merged 2 commits into
DiffCI:mainfrom
FredApps:fix/glob-regex-literals

Conversation

@FredApps

Copy link
Copy Markdown
Contributor

Fixes #247

globToRegex now escapes +, $, and ^ outside a character class before the glob conversion, and a bare ** compiles to a match-everything pattern. Character classes (including [^…]), groups and extglobs behave as before.

Related: #174 and #179 fix the planner and research-matcher copies of the same converter.

Validation:

  • tests/repo/glob-regex-literals.test.ts: three cases fail on main (the Remix route input among them), all pass here. Matches were checked against picomatch 4.
  • npm run typecheck, npm test (1171 pass), npm run build, npm run audit:boundary.

…ything with **

globToRegex escaped only backslashes and dots, so `+`, `$` and `^` reached RegExp as operators. A declared input naming a Remix route such as app/routes/users.$id.tsx matched nothing and its tests were not selected, app/routes/_auth+/** missed remix-flat-routes folders, and c++/** threw. A bare ** also stayed within one path segment. Groups, classes and extglobs behave as before, matching picomatch.

Signed-off-by: FredApps <[email protected]>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-review of 9106c17.

Checked:

  • The fix matches #247. +, $ and ^ are escaped after the class and extglob placeholders are taken out, so [^b], (a|b) and ?(x) keep working. A bare ** matches every path. c++/** no longer throws.
  • The new test fails with src/ reverted (3 of 4 fail) and passes with the fix. The expected values follow picomatch. tests/repo/glob-regex-literals.test.ts is listed in release-files.json. The commit is DCO-signed. The branch is level with main. CI is green.

Fixed: nothing.

Still open: none here. The planner and research copies of the converter are #173/#174 and #178/#179, as the issue says.

…ffCI#215

The manifest is an unordered set, and the PRs listed above add their entries at the same line. Moving this entry one line away lets them merge in either order without a conflict.

Signed-off-by: FredApps <[email protected]>
@FredApps
FredApps marked this pull request as ready for review November 18, 2026 01:16
@adityankale190895
adityankale190895 merged commit 26b1255 into DiffCI:main Nov 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test discovery: +, $ and ^ in a glob are read as regex operators

2 participants