Skip to content

[Repo Assist] test: add Seq module coverage for 7 untested functions; fix pending Seq.tail test#244

Merged
gdziadkiewicz merged 6 commits intomasterfrom
repo-assist/test-seq-coverage-2026-03-12-3b7073999ed37882
Mar 15, 2026
Merged

[Repo Assist] test: add Seq module coverage for 7 untested functions; fix pending Seq.tail test#244
gdziadkiewicz merged 6 commits intomasterfrom
repo-assist/test-seq-coverage-2026-03-12-3b7073999ed37882

Conversation

@github-actions
Copy link
Contributor

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

Summary

Improves test coverage for the Seq module in SeqTests.fs:

  1. Fixes a broken pending testptest "I should not be able to get the tail of a empty sequence" was using |> ignore which never enumerates the lazy sequence, so the ArgumentException was never thrown and the test could never pass. Fixed by calling |> Seq.toList |> ignore to actually iterate the sequence. The test is now a regular test and passes.

  2. Adds 11 new tests covering previously-untested Seq functions:

Function Tests added
Seq.span splits at predicate, empty input, always-true predicate
Seq.groupNeighboursBy consecutive grouping, empty input, with projection
Seq.catOptions mixed Some/None, all None
Seq.choice1s extracts Choice1Of2
Seq.choice2s extracts Choice2Of2
Seq.partitionChoices splits both directions
Seq.equalsWith equal, different value, different length

Test Status

FSharpx.Collections.Tests: 721 passed, 5 skipped, 0 failed

The 5 skipped tests are all pre-existing ptest entries 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).

Generated by Repo Assist ·

To install this agentic workflow, run

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

…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>
@gdziadkiewicz
Copy link
Collaborator

/repo-assist resolve conflicts

@gdziadkiewicz gdziadkiewicz self-assigned this Mar 14, 2026
@gdziadkiewicz gdziadkiewicz requested review from Copilot and gdziadkiewicz and removed request for Copilot March 14, 2026 13:09
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

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.tail empty-sequence exception test by forcing enumeration.
  • Add new tests covering Seq.span, Seq.groupNeighboursBy, Seq.catOptions, Seq.choice1s, Seq.choice2s, Seq.partitionChoices, and Seq.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.

gdziadkiewicz and others added 2 commits March 14, 2026 15:40
Co-authored-by: Copilot Autofix powered by AI <175728472+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

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.tail empty-sequence exception test by enumerating the lazy result.
  • Add new tests for Seq.span, plus additional tests around groupNeighboursBy, catOptions, choice*, partitionChoices, and 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.

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 ])
gdziadkiewicz and others added 2 commits March 14, 2026 17:03
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@gdziadkiewicz gdziadkiewicz marked this pull request as ready for review March 15, 2026 15:06
@gdziadkiewicz gdziadkiewicz merged commit 06f2a6d into master Mar 15, 2026
4 checks passed
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