Skip to content

fix: assertions for Result are not available for borrowed &Result#43

Merged
haraldmaida merged 1 commit into
mainfrom
fix/assertions-for-borrowed-result-are-not-available
Jun 5, 2025
Merged

fix: assertions for Result are not available for borrowed &Result#43
haraldmaida merged 1 commit into
mainfrom
fix/assertions-for-borrowed-result-are-not-available

Conversation

@haraldmaida
Copy link
Copy Markdown
Member

Borrowed &Result can not be asserted. Assertions like

assert_that!(&Ok(vec![1, 2, 3])).is_ok();
assert_that!(&Err("severe failure".to_string())).is_err();
assert_that!(&Ok(vec![1, ,2, 3])).has_value(&vec![1, 2, 3]);
assert_that!(&Ok(vec![1, 2, 3])).ok().contains_exactly(&[1, ,2 ,3]);
assert_that!(&Err("severe failure".to_string())).has_error_message("severe failure");

are expected to work, but result in compile errors.

Implemented assertions for Result for borrowed &Result as well.

@haraldmaida haraldmaida self-assigned this Jun 5, 2025
@haraldmaida haraldmaida added the bug Something isn't working label Jun 5, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.31%. Comparing base (60049e0) to head (22866af).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #43      +/-   ##
==========================================
+ Coverage   96.18%   96.31%   +0.12%     
==========================================
  Files          26       26              
  Lines        2965     3065     +100     
  Branches     2965     3065     +100     
==========================================
+ Hits         2852     2952     +100     
  Misses        109      109              
  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 1a77d11 into main Jun 5, 2025
18 checks passed
@haraldmaida haraldmaida deleted the fix/assertions-for-borrowed-result-are-not-available branch June 5, 2025 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant