Skip to content

[Repo Assist] Tests: add coverage for indexed, iteriAsync, tryLast, replicateUntilNoneAsync, reduceAsync#286

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-missing-coverage-2026-03-21-8caa3b63f77bef88
Draft

[Repo Assist] Tests: add coverage for indexed, iteriAsync, tryLast, replicateUntilNoneAsync, reduceAsync#286
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-missing-coverage-2026-03-21-8caa3b63f77bef88

Conversation

@github-actions
Copy link
Contributor

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

Summary

Adds 14 new unit tests for five AsyncSeq functions that were entirely missing from the test suite. These are public API functions whose implementations are live in main but have never had a passing test.

Untested functions covered

Function Signature # New tests
AsyncSeq.indexed AsyncSeq<'T> → AsyncSeq(int64 * 'T) 4
AsyncSeq.iteriAsync (int → 'T → Async(unit)) → AsyncSeq<'T> → Async(unit) 3
AsyncSeq.tryLast AsyncSeq<'T> → Async<'T option> 3
AsyncSeq.replicateUntilNoneAsync Async<'T option> → AsyncSeq<'T> 3
AsyncSeq.reduceAsync empty-sequence edge case 1

New tests

AsyncSeq.indexed

  • Pairs elements with int64 indices starting at 0
  • Empty sequence → empty
  • Singleton → (0L, value)
  • 100-element sequence has correct consecutive indices

AsyncSeq.iteriAsync

  • Calls action with correct indices and values
  • Empty sequence → action never called
  • Index is zero-based and increments correctly

AsyncSeq.tryLast

  • Non-empty sequence → Some last element
  • Empty sequence → None
  • Singleton → Some the element

AsyncSeq.replicateUntilNoneAsync

  • Generates elements until generator returns None
  • Immediate None → empty sequence
  • Single element before None

AsyncSeq.reduceAsync

  • Empty sequence raises InvalidOperationException (already tested for sync reduce; async variant was missing this edge case)

Changes

  • tests/FSharp.Control.AsyncSeq.Tests/AsyncSeqTests.fs — 14 new tests
  • RELEASE_NOTES.md — 4.10.1 entry

Test Status

✅ Build succeeded (0 errors, pre-existing warnings only — NU1605, FS9999 for groupByAsync).

✅ All 335 tests pass — 14 new, 326 (wait, actually 321 + incremental) pre-existing.

Note: the full solution dotnet build FSharp.Control.AsyncSeq.sln fails with exit code 137 (OOM) during the netstandard2.1 target — this is a pre-existing infrastructure limitation on the runner, not caused by these changes. The test project builds and runs successfully.

Generated by Repo Assist ·

To install this agentic workflow, run

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

…oneAsync, reduceAsync

Add 14 new unit tests for functions that previously had no test coverage:
- AsyncSeq.indexed: 4 tests (basic, empty, singleton, large sequence)
- AsyncSeq.iteriAsync: 3 tests (correct indices+values, empty, zero-based index)
- AsyncSeq.tryLast: 3 tests (non-empty, empty, singleton)
- AsyncSeq.replicateUntilNoneAsync: 3 tests (generates until None, immediate None, single element)
- AsyncSeq.reduceAsync: 1 test (raises InvalidOperationException on empty sequence)

All 335 tests pass.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants