Skip to content

[Repo Assist] test: add nested for-loop tests for task and async CE extensions#291

Merged
dsyme merged 3 commits intomainfrom
repo-assist/test-nested-loops-2026-03-58bd8dead007436c
Mar 7, 2026
Merged

[Repo Assist] test: add nested for-loop tests for task and async CE extensions#291
dsyme merged 3 commits intomainfrom
repo-assist/test-nested-loops-2026-03-58bd8dead007436c

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Mar 7, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds a NestedLoops module to both TaskSeq.TaskExtensions.Tests.fs and TaskSeq.AsyncExtensions.Tests.fs, testing the behaviour of nested for loops in task {} and async {} computation expressions when the outer sequence is an IAsyncEnumerable(T).

This is related to issue #269, which reports a NullReferenceException when nesting loops in Release mode. These tests cover the same code paths and serve as both regression guards and documentation of expected behaviour.

New tests

task {} CE (TaskSeq.TaskExtensions.Tests.fs):

  • Task-for CE with nested regular list inside taskSeq loop
  • Task-for CE with nested array inside taskSeq loop
  • Task-for CE with nested tuple-destructuring array inside taskSeq loop — mirrors issue Null reference exception when nesting loops in Release mode #269 pattern
  • Task-for CE with nested taskSeq inside taskSeq loop
  • Task-for CE with three levels of nesting

async {} CE (TaskSeq.AsyncExtensions.Tests.fs):

  • Async-for CE with nested regular list inside taskSeq loop
  • Async-for CE with nested array inside taskSeq loop
  • Async-for CE with nested tuple-destructuring array inside taskSeq loop
  • Async-for CE with nested taskSeq inside taskSeq loop

Test Status

✅ Build: succeeded (dotnet build -c Release)
✅ Tests: 3534 passed, 2 skipped, 0 failed (dotnet test -c Release)
✅ Formatting: clean (dotnet fantomas . --check)

Generated by Repo Assist ·

To install this agentic workflow, run

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

Add a NestedLoops module to both TaskExtensions and AsyncExtensions
test files covering:
- Outer taskSeq (IAsyncEnumerable) + inner regular list
- Outer taskSeq + inner regular array
- Outer taskSeq + inner zipped array with tuple destructuring (reproducing
  the pattern from issue #269)
- Outer taskSeq + inner taskSeq (nested async enumeration)
- Three levels of nesting (task CE only)

These tests document and guard the behaviour of nested iteration in both
the task {} and async {} computation expressions when the outer sequence
is an IAsyncEnumerable<T>.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review March 7, 2026 20:24
@dsyme dsyme merged commit f8789d1 into main Mar 7, 2026
4 checks passed
@dsyme dsyme deleted the repo-assist/test-nested-loops-2026-03-58bd8dead007436c branch March 7, 2026 20:24
Sign up for free to 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