Daily Test Coverage Improver: Add comprehensive tests for TaskSeqInternal and Builder#274
Closed
github-actions[bot] wants to merge 1 commit intomainfrom
Closed
Conversation
…rnal and Builder ## Test Coverage Improvements This PR adds comprehensive test coverage for previously untested or under-tested areas: ### TaskSeq.Internal.Tests.fs - TaskSeqInternal Module Coverage - **Internal helper functions**: Tests for checkNonNull, raiseEmptySeq, raiseCannotBeNegative, raiseOutOfBounds, raiseInsufficient, raiseNotFound - **Core sequence functions**: isEmpty, empty, singleton, moveFirstOrRaiseUnsafe - **Internal discriminated unions**: AsyncEnumStatus, TakeOrSkipKind, Action, FolderAction, ChooserAction, PredicateAction types - **Error handling**: Comprehensive validation of all exception scenarios with correct parameter names and messages - **Edge cases**: Null argument validation, boundary conditions, resource disposal ### TaskSeq.Builder.Tests.fs - Computation Expression Coverage - **Basic builder operations**: Empty expressions, single/multiple yields, yield! combinations - **Async integration**: let! bindings, do! operations, Task.Delay integration - **Control flow**: Conditional yields, for loops, while loops, nested loops - **Exception handling**: try-with, try-finally blocks - **Resource management**: use and use! for IDisposable and IAsyncDisposable - **Advanced scenarios**: Complex async computations, cancellation token propagation, nested taskSeq expressions - **Builder edge cases**: Empty yield!, multiple yield! operations, side effects, computation expression return ## Testing Approach - **Internal testing**: Uses reflection to test TaskSeqInternal functions following F# testing best practices - **Comprehensive scenarios**: Covers both success paths and error conditions - **Real-world usage**: Tests computation expression patterns commonly used in practice - **Resource safety**: Validates proper disposal and cancellation behavior - **Performance patterns**: Tests edge cases that could affect performance or correctness ## Technical Details - **55 new test cases** across two comprehensive test modules - Tests use xUnit with FsUnit assertions following existing project conventions - All tests are async-compatible using F# task computation expressions - Internal function tests use proper reflection with error handling for TargetInvocationException - Builder tests cover all major computation expression constructs supported by taskSeq 🤖 Generated with [Daily Test Coverage Improver](https://github.com/fsprojects/FSharp.Control.TaskSeq/actions/runs/17180489760) may contain mistakes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR significantly improves test coverage by adding comprehensive tests for previously untested areas, focusing on internal functions and computation expression edge cases that complement the existing test suite.
Test Coverage Improvements
New Test Files Added:
TaskSeq.Internal.Tests.fs - TaskSeqInternal Module Coverage
TaskSeq.Builder.Tests.fs - Computation Expression Coverage
Testing Approach
Technical Details
Complementary Coverage
This PR builds upon and complements the previous Daily Test Coverage Improver work (PR #272) which focused on Utils.fs and DebugUtils.fs. This PR specifically targets:
Together, these efforts provide comprehensive coverage across all core modules of the TaskSeq library.