fix: treenode filter pre-filter rejects parenthesised segments (#6026) by thomhurst · Pull Request #6027 · thomhurst/TUnit (original) (raw)

@thomhurst

MetadataFilterMatcher.IsWildcard only recognised * and ? as non-literal, so segments like (MyTest1), (A|B), !A, or Foo\.Bar were stored as literal hints. AotTestDataCollector's string-equality pre-filter then rejected every descriptor before MTP's TreeNodeFilter ever ran, returning zero tests for valid filters.

Rename to IsNonLiteralSegment and check the full MTP operator/escape set (* ? ( ) | & ! ). When a segment is non-literal the hint is skipped and MTP's TreeNodeFilter does the authoritative match downstream — no correctness loss, only the optimization is bypassed for that segment.

Adds direct unit tests against ExtractFilterHints (none existed before) plus end-to-end integration tests covering the patterns from the issue.

[claude[bot]](/apps/claude)

@thomhurst

…hars

Address PR #6027 review feedback:

[claude[bot]](/apps/claude)

@thomhurst

[claude[bot]](/apps/claude)

@thomhurst thomhurst deleted the fix/6026-treenode-filter-parentheses branch

May 28, 2026 16:01

@claude claude Bot mentioned this pull request

May 28, 2026

1 task

This was referenced

May 28, 2026

This was referenced

Jun 13, 2026

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

[ Show hidden characters]({{ revealButtonHref }})