Skip to content

feat!: implement Not expectation combinator and revise failure messages#52

Merged
haraldmaida merged 1 commit into
mainfrom
feat/not-expectation-combinator
Jun 13, 2025
Merged

feat!: implement Not expectation combinator and revise failure messages#52
haraldmaida merged 1 commit into
mainfrom
feat/not-expectation-combinator

Conversation

@haraldmaida
Copy link
Copy Markdown
Member

@haraldmaida haraldmaida commented Jun 13, 2025

Having a "not" combinator for expectations makes writing (custom) assertions more convinient.

Implemented the Not expectation combinator and adapted all implementations of currently provided expectations to make use of the Not combinator if feasible.

Additionally revised all failure messages mainly changing the phrases "is" or "has" to "to be" or "to have".

BREAKING CHANGES:

  • the signature of the trait method Expectation::message() is changed. The method message() has got the additional argument inverted: bool which is set when an expectation has been inverted with the Not combinator expectation.
  • all failure messages of assertions have been revised to use the phrases "to be..." and "to have..." instead of "is..." and "has..."

@haraldmaida haraldmaida self-assigned this Jun 13, 2025
@haraldmaida haraldmaida added the enhancement New feature or request label Jun 13, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 13, 2025

Codecov Report

Attention: Patch coverage is 93.57602% with 60 lines in your changes missing coverage. Please review.

Project coverage is 95.71%. Comparing base (0d1a1a7) to head (eedf13a).

Files with missing lines Patch % Lines
src/string/mod.rs 87.30% 4 Missing and 12 partials ⚠️
src/char/mod.rs 94.66% 2 Missing and 6 partials ⚠️
src/number.rs 93.69% 3 Missing and 4 partials ⚠️
src/order/mod.rs 89.55% 1 Missing and 6 partials ⚠️
src/char_count.rs 88.88% 0 Missing and 6 partials ⚠️
src/length.rs 90.90% 0 Missing and 6 partials ⚠️
src/range/mod.rs 89.13% 5 Missing ⚠️
src/result/mod.rs 90.90% 0 Missing and 2 partials ⚠️
src/error/mod.rs 95.65% 0 Missing and 1 partial ⚠️
src/iterator/mod.rs 98.87% 0 Missing and 1 partial ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
- Coverage   96.70%   95.71%   -0.99%     
==========================================
  Files          31       31              
  Lines        3425     3899     +474     
  Branches     3425     3899     +474     
==========================================
+ Hits         3312     3732     +420     
- Misses        109      118       +9     
- Partials        4       49      +45     

☔ View full report in Codecov by Sentry.
📢 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.

@haraldmaida haraldmaida merged commit 38c17a8 into main Jun 13, 2025
18 of 20 checks passed
@haraldmaida haraldmaida deleted the feat/not-expectation-combinator branch June 13, 2025 09:59
@haraldmaida haraldmaida changed the title feat: implement Not expectation combinator and revise failure messages feat!: implement Not expectation combinator and revise failure messages Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant