Skip to content

refactor: co-locate 17 more std module tests in std/<module>/ - #1636

Merged
paul-hammant merged 2 commits into
mainfrom
refactor/colocate-std-tests-batch2
Aug 18, 2026
Merged

refactor: co-locate 17 more std module tests in std/<module>/#1636
paul-hammant merged 2 commits into
mainfrom
refactor/colocate-std-tests-batch2

Conversation

@paul-hammant

Copy link
Copy Markdown
Collaborator

Continues #1634. Seventeen more specs move out of tests/regression/ to
sit beside the modules they cover: audio, bytes, cbor, clapae, config,
encoding, hash, language, message, msgpack, number, regex, schema,
strbuilder, time, url, worker
.

All 17 are pure R100 renames — no test content changed.

Selected by import, not by filename

A matching name is not evidence a test belongs to a module, so each
candidate was checked for actually importing its namesake. All 17 do.

test_message looked like a counter-example — it appeared to import only
map and string — until I noticed it imports via backticks
(import std.`message`(*)), which my first grep missed.

Deliberately not moved

About 45 regression tests import exactly one std module but are
compiler/codegen tests that merely use it: test_string_leak_*,
test_return_escape_*, test_closure_captures_ptr_and_string, and
similar. They exercise the heap tracker and closure lowering, not
std.string's API — filing them under std/string/ would misattribute
them. That judgement call is left for a human rather than guessed at.

The reference sweep — the thing I got wrong last time

In #1634 I grepped the unrenamed basenames and missed
emit_c_determinism's two pinned corpus entries; CI caught it. This time
the sweep was exhaustive: every old path across the whole tracked tree,
plus a targeted check of every file that pins a fixed file list.

Six references turned up. Four are comments/docs that were repointed so
they stay accurate — tests/regression/test_result_migration.ae,
tests/runtime/test_runtime_strbuilder.c,
tests/regression/test_std_strbuilder_v2.ae, std/schema/README.md.
None were build wiring, so nothing would have broken, but a comment
naming the wrong path is a trap for the next reader.

CHANGELOG.md and CHANGELOG-archive.md also name old paths and are
deliberately left alone: they record where those files were at the
time.

Verified

  • All 17 pass from their new homes — and passed at baseline before the
    move, so the move is the only variable
  • make test-ae discovers all 17, and the total holds at 965 — the
    risk with a move like this is tests going quiet rather than failing
  • Remaining 7 failures are the known environmental set (h2,
    background-server, Windows-cross, wycheproof); none name a moved test
    (an apparent url hit is curl in the h2 stress test — std_url_test_url
    itself PASSes)
  • Staged install ships 0 test files with all 136 modules present,
    so refactor: co-locate std module tests in std/<module>/ #1634's std/ trim covers these automatically with no Makefile change

🤖 Generated with Claude Code

paul-hammant and others added 2 commits August 17, 2026 22:37
Continues #1634. Seventeen more specs move out of tests/regression/ to sit
beside the modules they cover: audio, bytes, cbor, clapae, config,
encoding, hash, language, message, msgpack, number, regex, schema,
strbuilder, time, url, worker.

All 17 are pure R100 renames — no test content changed.

SELECTED BY IMPORT, NOT BY NAME. A matching filename is not evidence a
test belongs to a module, so each candidate was checked for actually
importing its namesake. All 17 do. (test_message looked like a
counter-example until I noticed it imports via backticks —
`import std.`message`(*)` — which my first grep missed.)

DELIBERATELY NOT MOVED: the ~45 regression tests that import exactly one
std module but are compiler/codegen tests which merely USE it —
test_string_leak_*, test_return_escape_*, test_closure_captures_*, and
the like. They exercise the heap tracker and closure lowering, not
std.string's API; filing them under std/string/ would misattribute them.
That judgement call is left for a human rather than guessed at.

Four comment/doc references repointed so they stay accurate:
tests/regression/test_result_migration.ae, tests/runtime/
test_runtime_strbuilder.c, tests/regression/test_std_strbuilder_v2.ae and
std/schema/README.md. None were build wiring, so nothing would have
broken — but a comment that names the wrong path is a small trap for the
next reader.

CHANGELOG.md and CHANGELOG-archive.md also name old paths and are
deliberately left alone: they record where those files were at the time.

The dangling-reference sweep was exhaustive this time, per old path across
the whole tracked tree, plus a targeted check of every file that pins a
fixed corpus. That is the check I got wrong in #1634, where I grepped
unrenamed basenames and missed emit_c_determinism's two entries.

Verified: 17/17 pass from their new homes (and passed at baseline before
the move); `make test-ae` discovers all 17 and the total holds at 965, so
nothing went quiet; the seven remaining failures are the known
environmental set (h2, background-server, Windows-cross, wycheproof);
a staged install ships 0 test files with all 136 modules present, so
#1634's std trim covers these automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Under a fresh [current] — the 0.550.0 release consumed main's, and this
PR touches std/ so the gate from #1632 requires one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@paul-hammant
paul-hammant merged commit 8d79d52 into main Aug 18, 2026
41 of 42 checks passed
@paul-hammant
paul-hammant deleted the refactor/colocate-std-tests-batch2 branch August 18, 2026 04:34
paul-hammant added a commit that referenced this pull request Aug 18, 2026
Resolves the CHANGELOG conflict — the "This branch has conflicts that must
be resolved" banner was right and my earlier reading of it as stale
outage metadata was wrong: main had moved (#1636 landed) and my local
origin/main was stale when I checked.

The conflict is the ordinary two-PRs-one-[current] collision, not the
release-fold hazard: both sides are live entries that must survive.
Kept BOTH under a single [current], ordered Added / Changed / Fixed —
Nic's check-docs and check-contrib-modules entries plus his Fixed
section, and main's std test co-location entry.

Verified all four entries are present and there is exactly one
[current] heading.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
paul-hammant added a commit that referenced this pull request Aug 18, 2026
Resolves the CHANGELOG conflict: seven commits landed on main since this
branch was cut, including #1636 (std test co-location) and #1638
(check-docs / check-contrib-modules gates).

Both sides are live [current] entries, so both are kept — Nic's Ruby 3.4
nil-ABI and typecheck_program leak fixes, alongside main's Added/Changed/
Fixed sections — merged section-by-section under one [current] in
Added / Changed / Fixed order. Verified all six entries survive and there
is exactly one [current] heading.

The Makefile merged cleanly, keeping both this branch's
tests/compiler/test_typechecker.c addition and main's python3 guard on
check-docs.

The two red jobs on this PR are NOT code failures. Both were cancelled
during yesterday's GitHub Actions outage: "WebAssembly (Emscripten)"
wedged in "Install native GCC" — a package-install step, before any
Aether code, with every later step skipped — and "64-bit Architecture
Tests" shows every step SUCCEEDED (392 passed, 0 failed, including the
pointer-size check) and was cancelled anyway. Re-running is all they
need.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant