Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enhance Opt class with new transformation methods#24

Merged
trippwill merged 1 commit intorelease/v2.7from
trippwill/and-or-overloads
Jan 3, 2025
Merged

Enhance Opt class with new transformation methods#24
trippwill merged 1 commit intorelease/v2.7from
trippwill/and-or-overloads

Conversation

@trippwill
Copy link
Member

Updated Opt.cs to add overloaded AndThen methods supporting nullable return types and introduced new OrThen methods for option handling. Added unit tests in OptTests.cs to validate the new functionality for both some and none cases.

Updated `Opt.cs` to add overloaded `AndThen` methods supporting nullable return types and introduced new `OrThen` methods for option handling. Added unit tests in `OptTests.cs` to validate the new functionality for both some and none cases.
@trippwill trippwill requested a review from Copilot January 3, 2025 15:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

test/libanvl.Opt.Test/OptTests.cs:359

  • Add a test for the AndThen method with Func<T, U?> and where U : struct to ensure its behavior is covered.
[Fact]

@codecov
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/libanvl.Opt/Opt.cs 60.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/libanvl.Opt/Opt.cs 67.90% <60.00%> (+0.79%) ⬆️

@github-actions
Copy link

github-actions bot commented Jan 3, 2025

Test Results

  3 files  ± 0    3 suites  ±0   0s ⏱️ ±0s
219 tests + 5  218 ✅ + 5  1 💤 ±0  0 ❌ ±0 
660 runs  +15  657 ✅ +15  3 💤 ±0  0 ❌ ±0 

Results for commit a05a55a. ± Comparison against base commit 03bad94.

This pull request removes 1 and adds 6 tests. Note that renamed tests count towards both.
libanvl.opt.test.OptTests ‑ Where_ReturnsNone_WhenPredicateIsFalse
libanvl.opt.test.OptTests ‑ AndThen_WithNullableFunc_ReturnsNone_WhenNone
libanvl.opt.test.OptTests ‑ AndThen_WithNullableFunc_ReturnsTransformedOption_WhenSome
libanvl.opt.test.OptTests ‑ OrThen_WithFunc_ReturnsFirstOption_WhenSome
libanvl.opt.test.OptTests ‑ OrThen_WithFunc_ReturnsTransformedOption_WhenNone
libanvl.opt.test.OptTests ‑ OrThen_WithOption_ReturnsFirstOption_WhenSome
libanvl.opt.test.OptTests ‑ OrThen_WithOption_ReturnsSecondOption_WhenNone

@trippwill trippwill merged commit 74bcfc9 into release/v2.7 Jan 3, 2025
13 of 14 checks passed
@trippwill trippwill deleted the trippwill/and-or-overloads branch January 3, 2025 15:59
trippwill added a commit that referenced this pull request Jan 3, 2025
Updated `Opt.cs` to add overloaded `AndThen` methods supporting nullable return types and introduced new `OrThen` methods for option handling. Added unit tests in `OptTests.cs` to validate the new functionality for both some and none cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant