Skip to content

[Repo Assist] test: add missing side-effect and Seq-equivalence tests for sum/average#320

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-sumby-sideeffects-2026-03-4e02cd9337359e5a
Draft

[Repo Assist] test: add missing side-effect and Seq-equivalence tests for sum/average#320
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-sumby-sideeffects-2026-03-4e02cd9337359e5a

Conversation

@github-actions
Copy link
Contributor

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

🤖 This is a draft PR from Repo Assist, an automated AI assistant.

What changed

Adds 44 new tests to TaskSeq.SumBy.Tests.fs, which covers sum, sumBy, sumByAsync, average, averageBy, and averageByAsync.

Missing side-effect tests (3 new [(Theory)] × variants each)

The SideEffects module previously tested only sum, sumBy, and averageBy. The following were missing:

New test Verifies
TaskSeq-sumByAsync iterates exactly once sumByAsync consumes the sequence once
TaskSeq-average iterates exactly once average consumes the sequence once
TaskSeq-averageByAsync iterates exactly once averageByAsync consumes the sequence once

Plus two tests that also verify the side-effect sequence advances on second consumption:

New test Verifies
TaskSeq-sum second iteration sees side-effect values Sum of 11..20 = 155 on second call
TaskSeq-averageBy second iteration sees side-effect values Avg of 11..20 = 15.5 on second call

Seq-equivalence tests (4 new [(Fact)] tests)

Adds tests confirming TaskSeq results match the F# Seq module for the same input, providing a specification oracle:

  • TaskSeq-sum result matches Seq-sum
  • TaskSeq-average result matches Seq-average
  • TaskSeq-sumBy result matches Seq-sumBy
  • TaskSeq-averageBy result matches Seq-averageBy

AI Disclosure

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

Test Status

Build: succeeded (Release configuration)
Tests: 4574 passed, 2 skipped, 0 failed (44 new tests added, up from 4530)
Formatting: dotnet fantomas . --check passes

Generated by Repo Assist ·

To install this agentic workflow, run

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

The SideEffects module previously tested only sum, sumBy, and averageBy.
This adds the 3 missing variants:
- sumByAsync iterates exactly once
- average iterates exactly once
- averageByAsync iterates exactly once

Plus 2 tests verifying side-effect sequences yield next values on re-iteration:
- sum second iteration sees side-effect values
- averageBy second iteration sees side-effect values

Also adds 4 new Immutable Fact tests confirming results match Seq equivalents:
- TaskSeq.sum matches Seq.sum
- TaskSeq.average matches Seq.average
- TaskSeq.sumBy matches Seq.sumBy
- TaskSeq.averageBy matches Seq.averageBy

Total new tests: 44 (from 28 to 72 in the SumBy module, 191 passed total in this file
including Theory variants). Full suite: 4574 passed.

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