lib: split bytes tests into equal/index/contains/tokenize/trim per ref/hare/bytes

Pure move: bytes_test.ww dissolves along its banner seams into sibling
equal_test.ww, index_test.ww (u8 + []u8 arms of index/rindex),
contains_test.ww (contains/hasprefix/hassuffix), tokenize_test.ww
(tokenize/rtokenize/peektoken/remainingtokens + splitn/rsplitn/split +
cut/rcut), and trim_test.ww, mirroring ref/hare/bytes/{equal,index,
contains,tokenize,trim}.ha ownership (Hare keeps splitn and cut in
tokenize.ha; contains.ha owns hasprefix/hassuffix). Blocks are
byte-identical; only the banner lines are deleted. Helpers stay with
their sole consumers: expect_token/expect_done/expect_tok in
tokenize_test.ww, beq in trim_test.ww.

Consumers: Makefile LIBRARY_TESTS replaces the bytes_test.ww entry
with the five new entries at the same position; the
test/byteid/libbyteid_test.ww roster row becomes five fx rows,
NENTEXPECT 48->52 (+4).
This commit is contained in:
2026-08-08 16:40:32 +09:00
parent 8a1dc641e3
commit 4f37a8b425
7 changed files with 347 additions and 329 deletions

View File

@@ -43,7 +43,7 @@ import time;
def MID: i32 = 0;
def MDIVERGE: i32 = 1;
def MWWREJECT: i32 = 2;
def NENTEXPECT: i32 = 51;
def NENTEXPECT: i32 = 55;
type ent = struct {
fixture: str, // repo-relative .ww; "" -> probe entry
@@ -83,12 +83,16 @@ fn pri(p: str, inc: str, sentinel: str, moddir: str) ent = {
return e;
};
// The 51-unit roster. Graduation history lives in git (the retired C
// The 55-unit roster. Graduation history lives in git (the retired C
// carrier's table comments); cites are kept only where a non-ID pin
// would need them.
fn corpus() []ent = {
let es: []ent = alloc([], NENTEXPECT: u64)!;
append(es, fx("lib/bytes/bytes_test.ww"));
append(es, fx("lib/bytes/equal_test.ww"));
append(es, fx("lib/bytes/index_test.ww"));
append(es, fx("lib/bytes/contains_test.ww"));
append(es, fx("lib/bytes/tokenize_test.ww"));
append(es, fx("lib/bytes/trim_test.ww"));
append(es, fx("lib/dirs/dirs_test.ww"));
append(es, fx("lib/encoding/base32/base32_test.ww"));
append(es, fx("lib/encoding/hex/hex_test.ww"));