Skip to content

[Repo Assist] test: expand choose/chooseAsync and filter/filterAsync test coverage#298

Merged
dsyme merged 2 commits intomainfrom
repo-assist/test-choose-expand-2026-03-2bf13a937c3f20af
Mar 7, 2026
Merged

[Repo Assist] test: expand choose/chooseAsync and filter/filterAsync test coverage#298
dsyme merged 2 commits intomainfrom
repo-assist/test-choose-expand-2026-03-2bf13a937c3f20af

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

Expands test coverage for TaskSeq.choose, TaskSeq.chooseAsync, TaskSeq.filter, and TaskSeq.filterAsync. These functions had only 7 tests each — this PR adds 8 new tests for choose/chooseAsync and 5 new tests for filter/filterAsync.

New tests

TaskSeq.Choose.Tests.fs

  • All Some — chooser always returns Some passes all 10 elements through (sync + async)
  • All None — chooser always returns None yields empty sequence (sync + async)
  • Singleton with Some chooser — verifies correct result from a length-1 source
  • Singleton with None chooser — verifies empty result from a length-1 source
  • Type-changing chooserint -> string option, exercises choose as a combined map+filter
  • Evaluation count — each source element is visited exactly once even when some are discarded (sync + async)

TaskSeq.Filter.Tests.fs

  • Keep all — predicate always true preserves all elements (sync + async via filter / filterAsync)
  • Remove all — predicate always false yields empty (sync + async)
  • Evaluation count — each source element is visited exactly once (sync)

Test Status

Build: ✅ succeeded (dotnet build src/FSharp.Control.TaskSeq.sln -c Release)
Tests: ✅ 169 passed, 0 failed (dotnet test --filter "TaskSeq.Tests.Choose|TaskSeq.Tests.Filter")

Generated by Repo Assist ·

To install this agentic workflow, run

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

Add missing test cases for TaskSeq.choose, TaskSeq.chooseAsync,
TaskSeq.filter, and TaskSeq.filterAsync:

choose/chooseAsync:
- All Some: chooser always returns Some passes all elements through
- All None: chooser always returns None yields empty
- Singleton with Some/None chooser
- Type-changing chooser (int -> string option)
- Evaluation count: each element visited exactly once

filter/filterAsync:
- Keep all: predicate always true preserves all elements
- Remove all: predicate always false yields empty
- Evaluation count: each element visited exactly once

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review March 7, 2026 22:03
@dsyme dsyme merged commit 76645cd into main Mar 7, 2026
4 checks passed
@dsyme dsyme deleted the repo-assist/test-choose-expand-2026-03-2bf13a937c3f20af branch March 7, 2026 22:07
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