Skip to content

Require string match patterns to consume terminal newlines - #619

Merged
fabiocaccamo merged 1 commit into
fabiocaccamo:mainfrom
fhgffy:fix/match-terminal-newline-20261009
Oct 11, 2026
Merged

fabiocaccamo merged 1 commit into
fabiocaccamo:mainfrom
fhgffy:fix/match-terminal-newline-20261009

Conversation

@fhgffy

@fhgffy fhgffy commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

String patterns currently match a key ending in a newline even when the pattern does not contain that newline. For example, match("key") returns both key and key\n.

Use a strict end anchor for string patterns. Add coverage for exact keys, explicit newlines, wildcards, and compiled regex patterns.

Validation: the new regression fails before the change; all 927 tests pass with one skip after it. Ruff lint/format checks, mypy (64 source files), and wheel/sdist builds pass.

Related issue

No linked issue.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have added tests for the proposed changes.
  • I have run the tests and there are not errors.

@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.51%. Comparing base (8c3371f) to head (c15df3f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #619   +/-   ##
=======================================
  Coverage   98.51%   98.51%           
=======================================
  Files          64       64           
  Lines        2430     2430           
=======================================
  Hits         2394     2394           
  Misses         36       36           
Flag Coverage Δ
unittests 98.51% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fabiocaccamo
fabiocaccamo merged commit d5f01b7 into fabiocaccamo:main Oct 11, 2026
18 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.

2 participants