Skip to content

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

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-using-sideeffects-20260428-3a2af19ea70e2418
Draft

[Repo Assist] test: add SideEffects module to TaskSeq.Using.Tests.fs#414
github-actions[bot] wants to merge 2 commits intomainfrom
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:

Test What it verifies
use — Dispose called exactly once per full iteration Single iteration → single dispose
use — Dispose called on each re-iteration 3× iterations → 3× disposes
use! — DisposeAsync called exactly once per full iteration Same as above for async path
use! — DisposeAsync called on each re-iteration Same counting for async path
use — Dispose called on early termination via take Abandoned enumerator is still disposed
use — multiple use bindings each get their own Dispose Two resources → two disposes per iteration
use — each re-iteration creates and disposes a fresh resource CE 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants