Skip to content

feat: implement soft assertions by providing new method Spec::soft_panic()#28

Merged
haraldmaida merged 2 commits into
mainfrom
soft_assertions
Apr 26, 2025
Merged

feat: implement soft assertions by providing new method Spec::soft_panic()#28
haraldmaida merged 2 commits into
mainfrom
soft_assertions

Conversation

@haraldmaida
Copy link
Copy Markdown
Member

Soft assertions are a useful feature of assertion libs. asserting should support soft assertions as well.

Implemented the new method Spec::soft_panic() to provide soft assertions. Soft assertions are started with either the macro verify_that! or the function verify_that(). This constructs a Spec with the failing strategy CollectFailures which collects the failures of multiple assertions instead of panicking immediately at the first failing assertion. To finally panic if at least one assertion failed, the method soft_panic() must be called after the last assertion.

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

codecov Bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.05%. Comparing base (67abdcc) to head (032cffd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #28      +/-   ##
==========================================
+ Coverage   94.01%   94.05%   +0.03%     
==========================================
  Files          24       24              
  Lines        2323     2338      +15     
  Branches     2323     2338      +15     
==========================================
+ Hits         2184     2199      +15     
  Misses        133      133              
  Partials        6        6              

☔ 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 37c0356 into main Apr 26, 2025
18 checks passed
@haraldmaida haraldmaida deleted the soft_assertions branch April 26, 2025 20:18
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