ocaml: phase 4 Set.Make / Map.Make functor application smoke tests (+3 tests, 572 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 26s

Functors were already wired through ocaml-make-functor in eval.sx
(curried host closure consuming module dicts) but had no explicit
tests for the user-defined Ord application path. This commit adds
three smoke tests that confirm:

  module IntOrd = struct let compare a b = a - b end
  module S = Set.Make (IntOrd)

  S.elements (fold-add [5;1;3;1;5])    sums to 9 (dedupe + sort)
  S.mem 2 (S.add 1 (S.add 2 (S.add 3 S.empty)))   = true
  M.cardinal (M.add 1 'a' (M.add 2 'b' M.empty))  = 2

The Ord parameter is properly threaded through the functor body —
elements are sorted in compare order and dedupe works.
This commit is contained in:
2026-05-09 05:35:19 +00:00
parent 5d33f8f20b
commit ec12b721e8
2 changed files with 20 additions and 0 deletions

View File

@@ -407,6 +407,13 @@ _Newest first._
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
'a tree`) with insert + in-order traversal. Tests parametric ADT,
recursive match, List.append, List.fold_left.
- 2026-05-09 Phase 4 — Set.Make / Map.Make functor application
smoke tests (+3 tests, 572 total). Functors were already wired
through ocaml-make-functor in eval.sx but had no explicit tests
for the user-defined Ord application path. Confirms that
`module S = Set.Make (IntOrd) ;; let s = ... in S.elements s`,
`S.mem 2 s`, and `Map.Make (IntOrd) ;; M.cardinal m` all work end
to end.
- 2026-05-09 Phase 6 — Filename module + Char.compare/equal/escaped
(+7 tests, 569 total). Filename: basename, dirname, extension,
chop_extension, concat, is_relative + dir_sep / current_dir_name /