Skip to content

Match a whole-string glob containing a space against the whole text [patch] - #169

Open
matt-edmondson wants to merge 3 commits into
mainfrom
fix/137-glob-whole-string-space
Open

matt-edmondson wants to merge 3 commits into
mainfrom
fix/137-glob-whole-string-space

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #137

What changed

Tests

  • GlobByWholeStringMatchesTextContainingASpace: "foo bar", "my file.txt" (also with surrounding spaces), and "my *.txt".
  • GlobByWholeStringWithASpaceStillNeedsTheWholeTextToMatch: "foo bar" does not match "foo bar baz", "foo bar" or "Foo bar" under CaseSensitive, and does match "Foo Bar" under CaseInsensitive.
  • GlobByWholeStringKeepsMultiplePatternsAndPrefixedTokens: the Glob with ByWholeString requires every optional token to match, so "*.jpg *.png" matches nothing #113 multi-pattern case, plus excluded and required tokens.
  • With the fix reverted, 4 tests fail. With it, the full suite passes on net10.0 (219/219).

Not done: the issue's optional idea of treating a double-quoted span as one token.


Generated by Claude Code

matt-edmondson and others added 2 commits October 31, 2026 05:29
…patch]

Under ByWholeString, a filter with only plain tokens and inner whitespace
is first tried as one glob against the whole text, so "my file.txt"
matches "my file.txt". The per-token pass still runs afterwards, so
"*.jpg *.png" keeps matching "a.png", and filters with excluded or
required tokens are unchanged.

Fixes #137

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW5pNp5mLi7vkHCEABR
@sonarqubecloud

Copy link
Copy Markdown

…ring-space

# Conflicts:
#	TextFilter.Test/TextFilterTests.cs
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.

Glob with ByWholeString can't match text containing a space: IsMatch("foo bar", "foo bar", Glob, ByWholeString) is false

2 participants