Skip to content

[Repo Assist] test: add coverage for untested List and Array module functions#245

Draft
github-actions[bot] wants to merge 2 commits intomasterfrom
repo-assist/test-list-array-coverage-2026-03-12-e393f6b997112caa
Draft

[Repo Assist] test: add coverage for untested List and Array module functions#245
github-actions[bot] wants to merge 2 commits intomasterfrom
repo-assist/test-list-array-coverage-2026-03-12-e393f6b997112caa

Conversation

@github-actions
Copy link
Contributor

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

Summary

Adds 33 new unit tests covering public functions in the List and Array modules (in Collections.fs) that had zero test coverage before this PR.

List module — new tests

Function Tests added
singleton 1
cons 1
findExactlyOne 3 (ok, no match, multiple matches)
skip / take 2 each (basic + boundary)
skipWhile / skipUntil 1 each
takeWhile / takeUntil 1 each
groupNeighboursBy 2 (non-empty, empty)
mapIf 1
catOptions 2
choice1s / choice2s 1 each
partitionChoices 1
equalsWith 3

Array module — new tests

Function Tests added
nth 1
setAt 1
findExactlyOne 2
centralMovingAverageOfOption 2
catOptions 1
choice1s / choice2s 1 each
partitionChoices 1
equalsWith 3

Test Status

✅ All 743 tests pass (dotnet testPassed: 743, Skipped: 6, Failed: 0). The 6 skipped tests are pre-existing.

Up from ~710 before the recent test addition PRs. This PR adds 33 new passing tests.

Generated by Repo Assist ·

To install this agentic workflow, run

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

Add 33 new tests covering functions in List and Array that had no
test coverage:

List: singleton, cons, findExactlyOne, skip, take, skipWhile,
skipUntil, takeWhile, takeUntil, groupNeighboursBy, mapIf,
catOptions, choice1s, choice2s, partitionChoices, equalsWith

Array: nth, setAt, findExactlyOne, centralMovingAverageOfOption,
catOptions, choice1s, choice2s, partitionChoices, equalsWith

Total test count increases from ~710 to 743.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds unit test coverage for previously untested public functions in the FSharpx.Collections List and Array extension modules (implemented in src/FSharpx.Collections/Collections.fs), increasing confidence in their baseline behavior.

Changes:

  • Add new List extension tests (e.g., singleton, cons, findExactlyOne, skip/take, groupNeighboursBy, equalsWith).
  • Add new Array extension tests (e.g., nth, setAt, findExactlyOne, centralMovingAverageOfOption, equalsWith).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/FSharpx.Collections.Tests/ListExtensionsTest.fs Adds unit tests covering multiple FSharpx.Collections.List public helpers.
tests/FSharpx.Collections.Tests/ArrayTests.fs Adds unit tests covering multiple FSharpx.Collections.Array public helpers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +94 to +98
Expect.throws "findExactlyOne no match" (fun () -> List.findExactlyOne ((=) 99) [ 1; 2; 3 ] |> ignore)
}

test "findExactlyOne throws when multiple elements match" {
Expect.throws "findExactlyOne multiple" (fun () -> List.findExactlyOne ((=) 1) [ 1; 1; 2 ] |> ignore)
}

test "findExactlyOne throws when multiple elements match" {
Expect.throws "findExactlyOne multiple" (fun () -> List.findExactlyOne ((=) 1) [ 1; 1; 2 ] |> ignore)
}

test "findExactlyOne throws when no element matches" {
Expect.throws "findExactlyOne no match"
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.

2 participants