[Repo Assist] test: add Seq module coverage for 7 untested functions; fix pending Seq.tail test#244
Conversation
…oices, groupNeighboursBy, equalsWith; fix ptest for Seq.tail - Activate the long-pending ptest for Seq.tail on empty input: the test was broken because `Seq.tail []` returns a lazy seq and `|> ignore` never enumerates it. Fix by calling `|> Seq.toList |> ignore` so the ArgumentException is actually raised. - Add 11 new deterministic tests covering previously-untested Seq functions: Seq.span, Seq.groupNeighboursBy, Seq.catOptions, Seq.choice1s, Seq.choice2s, Seq.partitionChoices, and Seq.equalsWith. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/repo-assist resolve conflicts |
There was a problem hiding this comment.
Pull request overview
Improves test coverage for the Seq extension module in FSharpx.Collections by enabling a previously pending Seq.tail test (fixing lazy evaluation in the assertion) and adding new unit tests for several previously untested Seq helpers.
Changes:
- Activate/fix the
Seq.tailempty-sequence exception test by forcing enumeration. - Add new tests covering
Seq.span,Seq.groupNeighboursBy,Seq.catOptions,Seq.choice1s,Seq.choice2s,Seq.partitionChoices, andSeq.equalsWith.
💡 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Seq test suite to (1) activate/fix the previously pending Seq.tail empty-input test by forcing enumeration and (2) add additional unit tests for Seq.span and other Seq helpers.
Changes:
- Activate the
Seq.tailempty-sequence exception test by enumerating the lazy result. - Add new tests for
Seq.span, plus additional tests aroundgroupNeighboursBy,catOptions,choice*,partitionChoices, andequalsWith.
💡 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.
| test "equalsWith returns false for different sequences" { Expect.isFalse "equalsWith" (Seq.equalsWith (=) [ 1; 2; 3 ] [ 1; 2; 4 ]) } | ||
|
|
||
| test "equalsWith returns false for sequences of different lengths" { | ||
| Expect.isFalse "equalsWith" (Seq.equalsWith (=) [ 1; 2 ] [ 1; 2; 3 ]) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Improves test coverage for the
Seqmodule inSeqTests.fs:Fixes a broken pending test —
ptest "I should not be able to get the tail of a empty sequence"was using|> ignorewhich never enumerates the lazy sequence, so theArgumentExceptionwas never thrown and the test could never pass. Fixed by calling|> Seq.toList |> ignoreto actually iterate the sequence. The test is now a regulartestand passes.Adds 11 new tests covering previously-untested
Seqfunctions:Seq.spanSeq.groupNeighboursBySeq.catOptionsSeq.choice1sSeq.choice2sSeq.partitionChoicesSeq.equalsWithTest Status
✅
FSharpx.Collections.Tests: 721 passed, 5 skipped, 0 failedThe 5 skipped tests are all pre-existing
ptestentries for bugs tracked in open PRs (#233, #238) — unchanged from before this PR.Previously: 709 passed, 6 skipped (the Seq.tail ptest was one of those 6 and is now activated).