iter 23.2.3-prep: reconcile workspace tests with auto-loaded prelude class Eq

The auto-loaded prelude (iter 23.2 work-in-progress) injects
`class Eq` plus three primitive instances (Eq Int, Eq Bool, Eq Str)
into every workspace. Five workspace::tests assertions broke against
this new baseline:

- iter22b1_missing_method_fires_diagnostic
- instance_without_superclass_instance_fires
- instance_overriding_nonexistent_method_fires
  Their fixtures redeclare `class Eq` (and `class Ord` in one case),
  which now collides with the prelude. Renamed each fixture's
  `Eq`/`eq` -> `TEq`/`teq` and `Ord`/`lt` -> `TOrd`/`tlt`, matching
  the scheme already used in the two earlier-renamed test_22b2
  fixtures. Method `ne` stays (does not collide). Assertion strings
  in workspace.rs updated to match.

- iter22b1_workspace_with_no_classes_has_empty_registry
- iter22b1_instance_in_class_module_loads_clean
  Their asserted registry counts assumed an otherwise-empty registry.
  Rewritten to filter by `defining_module != "prelude"`: the property
  is "no NON-prelude entries" / "exactly one fixture-owned entry",
  not raw count.

Doc comments updated alongside each assertion change so the rationale
for TEq/TOrd (collision avoidance) is local. No production code
touched.
This commit is contained in:
2026-05-10 22:34:30 +02:00
parent 84dcc46645
commit 7289bbc9d4
4 changed files with 53 additions and 32 deletions
@@ -4,9 +4,9 @@
"imports": [],
"defs": [
{
"kind": "class", "name": "Eq", "param": "a",
"kind": "class", "name": "TEq", "param": "a",
"methods": [{
"name": "eq",
"name": "teq",
"type": {
"k": "fn",
"params": [{ "k": "var", "name": "a" }, { "k": "var", "name": "a" }],
@@ -15,10 +15,10 @@
}]
},
{
"kind": "class", "name": "Ord", "param": "a",
"superclass": { "class": "Eq", "type": "a" },
"kind": "class", "name": "TOrd", "param": "a",
"superclass": { "class": "TEq", "type": "a" },
"methods": [{
"name": "lt",
"name": "tlt",
"type": {
"k": "fn",
"params": [{ "k": "var", "name": "a" }, { "k": "var", "name": "a" }],
@@ -28,10 +28,10 @@
},
{
"kind": "instance",
"class": "Ord",
"class": "TOrd",
"type": { "k": "con", "name": "Int" },
"methods": [{
"name": "lt",
"name": "tlt",
"body": { "t": "lit", "lit": { "kind": "bool", "value": true } }
}]
}