You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently should_fail_with expects a perfect match in the reason - it'd be great to extend this to allow for more flexible matching.
Happy Case
Support for e.g. regexes or wildcards might be overkill - at least checking that the expected reason is a substring of the actual reason would be I think a great improvement.
The text was updated successfully, but these errors were encountered:
…he expected message (#5319)
# Description
## Problem
Resolves#4786
## Summary
`#[test(should_fail_with = "message")]` will now check that "message" is
a substring of the failure reason. I _think_ this is a
backwards-compatible change.
I thought about supporting regular expressions, as suggested in the
related issue, but I didn't know how to signal that it's a regex or just
"contains". I guess that could be done with another name, something like
`should_with_with_regexp` 🤔 (in a separate PR, if really needed/wanted)
## Additional Context
None
## Documentation
Check one:
- [ ] No documentation needed.
- [x] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.
# PR Checklist\*
- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
Problem
Currently
should_fail_with
expects a perfect match in the reason - it'd be great to extend this to allow for more flexible matching.Happy Case
Support for e.g. regexes or wildcards might be overkill - at least checking that the expected reason is a substring of the actual reason would be I think a great improvement.
The text was updated successfully, but these errors were encountered: