A fresh disk for every test, fixtures included

A fixture built by makedisks.sh was handed to each test where it lay. Twenty
four tests name disks/cosmos.img and several of them write to one, so a test
could hand the next one a disk with its leavings on.

romBoot is what found it. Its recorded output described a directory that
selfBoot had made earlier in the same run, so it passed in a full run and failed
on its own - which is the worst way round for a test to be wrong, because the
form nobody runs is the one telling the truth. Its recording now says "made"
like selfBoot's, which is what running the same input on the same disk should
always have said.

Fixed as a class rather than as an instance: run.sh copies a fixture before
attaching it, the same way it already removed a scratch image. Then every one of
the 138 run and rom tests was run on its own to see whether anything else was
leaning on what ran before it. Nothing was, before or after.

Also, cosmosEditKeys.in was written by Python's write_text, which encodes as
UTF-8, so every key byte was 0xC2 and then the key. The test passed anyway,
because the shell ignores a byte it has no use for - a fixture working for a
reason it was not built on, which is exactly the thing that stops working
without anybody touching it. Written as bytes now; the recording is unchanged,
which is the proof the stray bytes were being ignored.

docs.sh is what caught that, and it turns out to draw the line in the right
place by construction: a deliberately binary fixture does not decode as UTF-8
and is skipped, while one that is accidentally UTF-8 decodes and is reported.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-09-01 11:22:43 -04:00
co-authored by Claude Opus 5
parent 736037462e
commit 373454ec00
4 changed files with 36 additions and 15 deletions
+10 -1
View File
@@ -350,7 +350,7 @@ them. Four forms:
| Form | Meaning |
| --- | --- |
| `name.img` | Scratch. Removed before the run, so the emulator makes a blank one |
| `disks/name.img` | A fixture built by `makedisks.sh`, used as it stands |
| `disks/name.img` | A fixture built by `makedisks.sh`, copied fresh for the run |
| `...:ro` | Attached write protected, so a test can check the *device* bars writes |
| `...@N` | Given a latency of N cycles, so a test can check the filesystem waits |
@@ -358,6 +358,15 @@ The `@N` form deserves a note. Every other test runs with the disk's answer avai
before the next instruction, which is the one condition under which failing to wait looks
exactly like working.
**Both kinds of disk are fresh for every test**, and the fixture was not always. It used to
be handed to each test where it lay, and twenty four tests name `disks/cosmos.img` while
several of them write to one. `romBoot` was the test that found it: its recorded output
described a directory that `selfBoot` had made earlier in the same run, so it passed in a
full run and failed on its own. **That is the worst way round for a test to be wrong** - the
form nobody runs is the one that tells the truth - and the shape of it is worth naming,
because it is the same shape as a program that works only because of what ran before it.
The whole suite was checked one test at a time afterwards, and that was the only one.
**keys** names a file in `Tests/input` to be fed to the console as a *keyboard* rather than
as standard input, and the difference between those is the whole reason the field exists.