[Repo Assist] test: add SideEffects module to TaskSeq.Unfold.Tests.fs#405
Open
github-actions[bot] wants to merge 2 commits intomainfrom
Open
[Repo Assist] test: add SideEffects module to TaskSeq.Unfold.Tests.fs#405github-actions[bot] wants to merge 2 commits intomainfrom
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
Adds 6 new tests covering: - Generator side-effects accumulate across re-iterations (both sync and async) - take stops the generator after the requested number of elements - Exceptions thrown inside sync and async generators propagate correctly Before: 14 test runs After: 20 test runs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
12 tasks
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 is an automated pull request from Repo Assist, an AI assistant.
Summary
TaskSeq.Unfold.Tests.fshadEmptySeqandFunctionalitymodules but was missing aSideEffectsmodule, unlike most other test files in the suite.This PR adds a
SideEffectsmodule with 6 new tests:New tests
unfold generator side-effects accumulate across re-iterations(sync): Closes over mutable external state; verifies that re-iterating calls the generator fresh from the initial seed but the external counter keeps climbing — 4 calls per iteration (3 Some + 1 None), so 8 total after two iterations.unfoldAsync generator side-effects accumulate across re-iterations(async): Same verification for the async variant.unfold with take stops generator calls at the limit(sync): An always-Someinfinite generator combined withtake 5; proves the generator is called exactly 5 times — no extra sentinel call is needed when the source never returnsNone.unfoldAsync with take stops generator calls at the limit(async): Same for the async variant.unfold propagates exception thrown inside the generator: Verifies that afailwithatn = 3surfaces asSystem.Exceptionwhen the sequence is consumed.unfoldAsync propagates exception thrown inside the async generator: Same for the async variant.Test growth
Test Status
dotnet build src/FSharp.Control.TaskSeq.Test -c Release— succeeded (0 warnings, 0 errors)dotnet test --filter Unfold -c Release— 20 passed, 0 faileddotnet fantomas src/.../TaskSeq.Unfold.Tests.fs --check— clean