Skip to content

Add additional replace overlap edge case tests#63

Open
Supan-Roy wants to merge 1 commit intoimageworks:masterfrom
Supan-Roy:add-tests
Open

Add additional replace overlap edge case tests#63
Supan-Roy wants to merge 1 commit intoimageworks:masterfrom
Supan-Roy:add-tests

Conversation

@Supan-Roy
Copy link
Copy Markdown

Adds additional Python compatibility edge case tests for replace(), including overlapping patterns, empty replacements, replacement limits, and boundary cases.

Copilot AI review requested due to automatic review settings May 11, 2026 05:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds additional Python 3 compatibility tests for pystring::replace() to cover non-overlapping replacement behavior and boundary cases, helping ensure behavior matches str.replace() across tricky inputs.

Changes:

  • Add a new python3_compat test case (replace_overlap) covering repeated/adjacent matches (non-overlapping behavior).
  • Add coverage for empty replacement strings, not-found patterns, empty input strings, and empty search patterns.
  • Add coverage for count-limited replacements on repeated substrings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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