[Repo Assist] test: add coverage for untested List and Array module functions#245
Draft
github-actions[bot] wants to merge 2 commits intomasterfrom
Draft
Conversation
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>
29 tasks
Contributor
There was a problem hiding this comment.
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
Listextension tests (e.g.,singleton,cons,findExactlyOne,skip/take,groupNeighboursBy,equalsWith). - Add new
Arrayextension 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds 33 new unit tests covering public functions in the
ListandArraymodules (inCollections.fs) that had zero test coverage before this PR.List module — new tests
singletonconsfindExactlyOneskip/takeskipWhile/skipUntiltakeWhile/takeUntilgroupNeighboursBymapIfcatOptionschoice1s/choice2spartitionChoicesequalsWithArray module — new tests
nthsetAtfindExactlyOnecentralMovingAverageOfOptioncatOptionschoice1s/choice2spartitionChoicesequalsWithTest Status
✅ All 743 tests pass (
dotnet test—Passed: 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.