Skip to content

[Repo Assist] fix: enable and fix experimental tests for issues #115 and #116#240

Merged
gdziadkiewicz merged 2 commits intomasterfrom
repo-assist/fix-experimental-tests-115-116-4e5d599-c320f049d9e9f407
Mar 14, 2026
Merged

[Repo Assist] fix: enable and fix experimental tests for issues #115 and #116#240
gdziadkiewicz merged 2 commits intomasterfrom
repo-assist/fix-experimental-tests-115-116-4e5d599-c320f049d9e9f407

Conversation

@github-actions
Copy link
Contributor

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

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

Fixes two long-standing experimental test issues by making the tests actually run.

SkewBinomialHeap — closes #115

Root cause: The module-level nonEmptyOnly generator called iComparableGen(), which attempted to use Arb.generate to produce System.IComparable interface instances. FsCheck cannot automatically generate values for interface types and throws:

The type System.IComparable is not handled automatically by FsCheck.

This caused all three ptestPropertyWithConfig tests that depended on this generator to fail as soon as they were enabled, which is why they had been left as ptest.

Fix:

  • Remove iComparableGen().
  • Replace Arb.generate<'T> / Gen.nonEmptyListOf <| iComparableGen() with Arb.generate(int) in the module-level emptyOnly / nonEmptyOnly generators.
  • Add Gen.choose(0, 12) / Gen.length1thru12 size bounds (consistent with the project guidance in FsCheckProperties.fs: "recommend a range of size 1–12 for lists used to build test data structures") to keep the generators fast enough for 10,000 FsCheck rounds.
  • Promote three ptestPropertyWithConfigtestPropertyWithConfig:
    • "toList returns the same as toSeq |> List.ofSeq"
    • "merge throws when both heaps have diferent ordering"
    • "Equality reflexivity"

DList — closes #116

Root cause: The three ptest "test ofSeq …" tests asserted structural equality against a right-leaning Join tree built with cons, but DList.ofSeq builds a left-leaning tree via snoc. Because DList.op_Equality compares node structure, not just element sequence, the tests would always fail when enabled.

Fix: Rewrite each test to check observable behaviour — DList.ofSeq input |> DList.toSeq |> Seq.toList = [0;1;2;3;4] — which is the correct contract for ofSeq without coupling tests to internal representation. Promote all three from ptest to test.

Test Status

Suite Passed Skipped Failed
FSharpx.Collections.Tests 706 6 0
Experimental DList 14 0 0
Experimental SkewBinomialHeap 29 0 0

The 6 skipped core tests are pre-existing skips unrelated to this change.

Closes #115
Closes #116

Generated by Repo Assist ·

To install this agentic workflow, run

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

SkewBinomialHeapTest.fs (closes #115):
- Remove broken iComparableGen() helper that tried to generate IComparable
  values via FsCheck — FsCheck cannot automatically generate interface
  instances, causing a runtime exception in all three property tests that
  depended on it.
- Replace with Arb.generate<int> throughout the module-level emptyOnly /
  nonEmptyOnly generators.
- Add Gen.choose(0, 12) / Gen.length1thru12 size bounds (consistent with
  the project guidance in FsCheckProperties.fs) so the generators stay fast
  at 10,000 test cases.
- Promote the three ptestPropertyWithConfig tests to testPropertyWithConfig:
  * 'toList returns the same as toSeq |> List.ofSeq'
  * 'merge throws when both heaps have diferent ordering'
  * 'Equality reflexivity'

DListTest.fs (closes #116):
- The three ofSeq ptest tests were checking internal DList node structure,
  not observable behaviour. The current ofSeq implementation builds a
  left-leaning tree (via snoc) while the expected value was a right-leaning
  tree (built with cons), so they would always fail when enabled.
- Rewrite each test to compare DList.toSeq output against the expected
  element sequence [0;1;2;3;4], which correctly captures the contract
  of ofSeq without coupling tests to the internal representation.
- Promote all three from ptest to test.

Test status:
- FSharpx.Collections.Tests: 706 passed, 6 skipped, 0 failed
- Experimental DList: 14 passed, 0 ignored, 0 failed
- Experimental SkewBinomialHeap: 29 passed, 0 ignored, 0 failed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gdziadkiewicz gdziadkiewicz marked this pull request as ready for review March 14, 2026 12:47
@gdziadkiewicz gdziadkiewicz merged commit 5067316 into master Mar 14, 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.

Experimental DList Tests failing Experimental SkewBinomialHeap Tests failing

1 participant