Skip to content

Conversation

@github-actions
Copy link
Contributor

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 - 25 test cases covering TaskSeqInternal module functions
  • TaskSeq.Builder.Tests.fs - 30 test cases covering computation expression edge cases

TaskSeq.Internal.Tests.fs - TaskSeqInternal Module Coverage

  • Internal helper functions: 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

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:

  1. TaskSeqInternal.fs - Internal helper functions that were identified as needing direct testing
  2. TaskSeqBuilder.fs - Computation expression edge cases and advanced scenarios

Together, these efforts provide comprehensive coverage across all core modules of the TaskSeq library.

🤖 AI-generated content by Daily Test Coverage Improver may contain mistakes.

…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.
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.

2 participants