Add assert_string_matches_format assertion#591
Merged
Chemaclass merged 2 commits intomainfrom Feb 21, 2026
Merged
Conversation
Contributor
✅ Contributor ReportUser: @Chemaclass
Contributor Report evaluates based on public GitHub activity. Analysis period: 2025-02-21 to 2026-02-21 |
6a427f0 to
43f78cb
Compare
Adds PHPUnit-style format assertions with placeholders: %d (digits), %i (signed int), %f (float), %s (non-whitespace), %x (hex), %e (scientific), %% (literal percent).
43f78cb to
a457dd3
Compare
b7f40a8 to
d9f117a
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Background
Related #177
Adds PHPUnit-style format matching assertions, allowing users to validate strings against format patterns with placeholders instead of writing raw regex.
💡 Changes
assert_string_matches_formatandassert_string_not_matches_formatassertions%d(digits),%i(signed int),%f(float),%s(non-whitespace),%x(hex),%e(scientific),%%(literal %)bashunit::format_to_regexhelper that converts format strings to regex with proper escaping