Skip to content

refactor: change signature of methods of AssertCodePanics trait so that …#36

Merged
haraldmaida merged 1 commit into
mainfrom
fix/change-assertcodepanics-methods-to-be-callable-only-once
May 10, 2025
Merged

refactor: change signature of methods of AssertCodePanics trait so that …#36
haraldmaida merged 1 commit into
mainfrom
fix/change-assertcodepanics-methods-to-be-callable-only-once

Conversation

@haraldmaida
Copy link
Copy Markdown
Member

…code assertions can not be chained

Assertions whether a closure panics or does not panic can not be chained. A closure can only be asserted once. Currently it is possible to write chained assertions for a closure, but the second assertion panics at runtime.

Instead of a runtime error, a compile time error should be issued, when a chained assertion is written for a closure.

The signature of the methods of the extension trait AssertCodePanics have been changed to return a Spec with a subject of the unit type. It is now longer possible to compile chained assertions for panicking code on closures.

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

codecov Bot commented May 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.92%. Comparing base (148acb0) to head (1240e00).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
- Coverage   96.13%   95.92%   -0.21%     
==========================================
  Files          25       25              
  Lines        2849     2850       +1     
  Branches     2849     2850       +1     
==========================================
- Hits         2739     2734       -5     
- Misses        106      112       +6     
  Partials        4        4              

☔ 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 bd39c80 into main May 10, 2025
17 of 18 checks passed
@haraldmaida haraldmaida deleted the fix/change-assertcodepanics-methods-to-be-callable-only-once branch May 10, 2025 10:02
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