lib: split log tests into funcs+global per ref/hare/log

Pure move: log_test.ww dissolves along its banner seams into
funcs_test.ww (the six logger-arg rows — lprintlnbasic/single/empty,
lprintflnbasic/indexed/mods — plus the fatal-family subprocess TODO;
ref/hare/log/funcs.ha owns lprintln/lprintfln and the fatal/lfatal
forms) and global_test.ww (defaultwiredtoglobal, setloggerswap,
printflnglobal; ref/hare/log/global.ha owns default/global/setlogger).
Moved blocks are byte-identical; the 9 banner lines are deleted.
Imports minimized per file (log + memio; the stale fmt/io imports
drop).

Helper inventory: streq spans both halves (all six funcs rows;
setloggerswap + printflnglobal on the global side), so it is
duplicated under per-file names per the sanctioned strconv
streq/fstreq precedent — fstreq in funcs_test.ww (decl + 6 call
sites), gstreq in global_test.ww (decl + 6 call sites); bodies
byte-identical apart from the name. Line-multiset diff old-vs-concat
(heads/banners excluded, names normalized): the only residue is the
9-line streq helper counted twice.

Order-safety, proven on the composed run: dir-mode executes
declaration order per file, files byte-lexicographic (funcs_test <
global_test < silent_test). Observed order: lprintlnbasic,
lprintlnsingle, lprintlnempty, lprintflnbasic, lprintflnindexed,
lprintflnmods, defaultwiredtoglobal, setloggerswap, printflnglobal,
silentwritesnothing, silentignoresprintfln — defaultwiredtoglobal
still precedes every log.setlogger caller (setloggerswap and
printflnglobal, both later in its own file; funcs and silent rows
never call setlogger).

Consumers: Makefile LIBRARY_TESTS replaces the log_test.ww entry with
the two new entries in place; test/byteid/libbyteid_test.ww roster row
becomes two fx rows, NENTEXPECT 59->60.

Validation: standalone ww test lib/log/funcs_test.ww (6 passed) and
lib/log/global_test.ww (3 passed); dir mode ww test lib/log (11
passed, no duplicate symbols); byteid compile-only build exit 0, 60
roster appends == NENTEXPECT.
This commit is contained in:
2026-08-08 17:34:00 +09:00
parent 291860ddef
commit 53919b3404
5 changed files with 205 additions and 203 deletions

View File

@@ -43,7 +43,7 @@ import time;
def MID: i32 = 0;
def MDIVERGE: i32 = 1;
def MWWREJECT: i32 = 2;
def NENTEXPECT: i32 = 59;
def NENTEXPECT: i32 = 60;
type ent = struct {
fixture: str, // repo-relative .ww; "" -> probe entry
@@ -83,7 +83,7 @@ fn pri(p: str, inc: str, sentinel: str, moddir: str) ent = {
return e;
};
// The 59-unit roster. Graduation history lives in git (the retired C
// The 60-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 = {
@@ -155,7 +155,8 @@ fn corpus() []ent = {
append(es, fx("lib/ascii/ascii_test.ww"));
append(es, fx("lib/encoding/base64/base64_test.ww"));
append(es, fx("lib/errors/errno_test.ww"));
append(es, fx("lib/log/log_test.ww"));
append(es, fx("lib/log/funcs_test.ww"));
append(es, fx("lib/log/global_test.ww"));
append(es, fx("lib/log/silent_test.ww"));
append(es, fx("lib/os/stat_test.ww"));
// toktest/asttest resolve `import syntax` via -I lib/ww, cf 905