[Repo Assist] test: expand TaskSeq.fold tests with call-count, ordering, and edge case coverage#348
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
Conversation
…ase coverage Adds a new Functionality module and extends existing tests in TaskSeq.Fold.Tests.fs. The file grows from 95 to ~270 lines, exercising scenarios previously absent: - Verify folder is NOT called when the source is empty - Verify folder is called exactly N times for N-element sequences - Single-element and two-element minimal cases - Left-associativity / application order (non-commutative string concat) - Null initial state for reference-type accumulators - fold and foldAsync produce the same result for pure functions - List accumulation preserving order - Summary tests using TestImmTaskSeq variants (sum 1..10 = 55) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
TaskSeq.Fold.Tests.fspreviously had only 95 lines of test coverage across three sparse modules. This PR expands it to ~270 lines by adding a newFunctionalitymodule and extending theEmptySeqmodule with tests for scenarios that were previously absent.New tests added
EmptySeqmodule (2 new tests):fold does not call folder function when empty— verifies the folder is never invoked when the source sequence is empty (the initial state is returned immediately)foldAsync does not call folder function when empty— same for the async variantFunctionalitymodule (12 new tests):fold f s [a;b;c] = f (f (f s a) b) cfoldandfoldAsyncreturn the same result for pure functionsfoldandfoldAsyncsumming over allTestImmTaskSeqvariantsChanges
TaskSeq.Fold.Tests.fsFunctionalitymodule, extendedEmptySeqrelease-notes.txt1.0.0Test Status
✅ Build:
dotnet build src/FSharp.Control.TaskSeq.sln -c Release— succeeded, 0 warnings, 0 errors✅ Format:
dotnet fantomas src/FSharp.Control.TaskSeq.Test/TaskSeq.Fold.Tests.fs— applied, then verified clean✅ Tests (fold only):
dotnet test ... --filter "FullyQualifiedName~TaskSeq.Tests.Fold"— 90 passed, 0 failed