Skip to content

[Repo Assist] test: add SideEffects module to TaskSeq.CompareWith.Tests.fs - #399

Merged
dsyme merged 2 commits into
mainfrom
repo-assist/test-comparewith-sideeffects-20260421-eefc487d4b74f6c1
Apr 21, 2026
Merged

[Repo Assist] test: add SideEffects module to TaskSeq.CompareWith.Tests.fs#399
dsyme merged 2 commits into
mainfrom
repo-assist/test-comparewith-sideeffects-20260421-eefc487d4b74f6c1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant.

Summary

TaskSeq.CompareWith.Tests.fs had a comprehensive EmptySeq and Immutable module but was missing a SideEffects module — unlike most other test files in the suite.

This PR adds a SideEffects module with 4 new test scenarios:

New tests

  1. compareWith consumes both sequences exactly once when equal: Uses inline counters to verify each source is enumerated fully and exactly once across the full comparison.

  2. compareWith stops consuming sources after first non-zero comparison: Verifies the early-exit behaviour: when the first pair of elements differs, compareWith advances each enumerator only once (the pre-loop MoveNextAsync) and does not read further elements.

  3. compareWith two fresh side-effect sequences compare as equal (TestSideEffectTaskSeq variants): Two independent calls to getSeqWithSideEffect both yield 1..10; their comparison should be 0.

  4. compareWithAsync two fresh side-effect sequences compare as equal (TestSideEffectTaskSeq variants): Same as above but for the async comparer overload.

Test growth

BeforeAfter
~50 xUnit test runs~76 xUnit test runs

Test Status

  • Build: ✅ dotnet build src/FSharp.Control.TaskSeq.sln -c Release — succeeded (0 warnings, 0 errors)
  • Tests: ✅ dotnet test --filter CompareWith -c Release — 76 passed
  • Format: ✅ dotnet fantomas . --check — passed

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@96b9d4c39aa22359c0b38265927eadb31dcf4e2a

Add a SideEffects module with 4 new test scenarios covering:
- Both sources consumed exactly once when sequences are equal
- Early exit: sources consumed only 1 element each when first comparison differs
- TestSideEffectTaskSeq variants for compareWith and compareWithAsync
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme
dsyme marked this pull request as ready for review April 21, 2026 10:09
@dsyme
dsyme merged commit fc687a3 into mainApr 21, 2026
5 checks passed
@dsyme
dsyme deleted the repo-assist/test-comparewith-sideeffects-20260421-eefc487d4b74f6c1 branch April 21, 2026 10:14
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@dsyme