Skip to content

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

Merged
dsyme merged 7 commits into
mainfrom
repo-assist/test-using-sideeffects-20260428-3a2af19ea70e2418
May 1, 2026
Merged

[Repo Assist] test: add SideEffects module to TaskSeq.Using.Tests.fs#414
dsyme merged 7 commits into
mainfrom
repo-assist/test-using-sideeffects-20260428-3a2af19ea70e2418

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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

Summary

Adds a SideEffects module to TaskSeq.Using.Tests.fs with 7 new tests that verify Dispose/DisposeAsync call-count semantics for the use and use! CE bindings.

The existing tests (6 tests) only check that the disposed flag is set after a single iteration. The new tests cover:

TestWhat it verifies
use — Dispose called exactly once per full iterationSingle iteration → single dispose
use — Dispose called on each re-iteration3× iterations → 3× disposes
use! — DisposeAsync called exactly once per full iterationSame as above for async path
use! — DisposeAsync called on each re-iterationSame counting for async path
use — Dispose called on early termination via takeAbandoned enumerator is still disposed
use — multiple use bindings each get their own DisposeTwo resources → two disposes per iteration
use — each re-iteration creates and disposes a fresh resourceCE body re-runs on each GetAsyncEnumerator call

Two small helper types are added at module level:

  • CountingDisposable — increments an int ref in Dispose
  • CountingAsyncDisposable — increments an int ref in DisposeAsync

These make exact call-count assertions straightforward without the bool ref pattern used by the existing tests.

Test Status

✅ All 5258 tests pass (Release, net10.0).

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 7 new tests in a SideEffects module that verify disposal
semantics for the use and use! CE bindings:
- Dispose/DisposeAsync called exactly once per full iteration
- Dispose/DisposeAsync called on each re-iteration (3×)
- Dispose called on early termination via TaskSeq.take
- Multiple use bindings each trigger their own Dispose
- Each re-iteration creates and disposes a fresh resource
Two new helper types (CountingDisposable, CountingAsyncDisposable)
make it easy to assert exact call counts without the bool-ref
pattern used by the existing tests.
All 5258 tests pass (Release, net10.0).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme
dsyme marked this pull request as ready for review May 1, 2026 16:51
@dsyme
dsyme merged commit 15e84df into mainMay 1, 2026
4 of 5 checks passed
@dsyme
dsyme deleted the repo-assist/test-using-sideeffects-20260428-3a2af19ea70e2418 branch May 1, 2026 17:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automationenhancementNew feature or requestrepo-assist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@dsyme