lib: split bufio tests into stream+scanner per ref/hare/bufio
Pure move: bufio_test.ww dissolves along its banner seams into
stream_test.ww (13 stream* rows) and scanner_test.ww (13 scan*/
newscanner*/emptystream/errorsource/boundarycases/multifill/
readaheadcantgrow rows), mirroring ref/hare/bufio/{stream_test+test.ha,
scanner_test+test.ha} ownership. streamscannerunread stays stream-side:
Hare's stream-level unread test lives in stream_test+test.ha:86.
Moved blocks are byte-identical; the 28 file-scope banner lines (and
their // continuation lines) are deleted, the 2 interior banners inside
boundarycases stay. Imports minimized per file (the unused `import
bytes;` drops; utf8 is scanner-only).
Helper inventory: putstr spans both halves (7 scanner rows / 8 call
sites; 8 stream rows / 8 call sites), so it is duplicated under
per-file names per the sanctioned strconv streq/fstreq precedent —
scanner_test.ww keeps `putstr`, the stream copy is `sputstr` (decl,
head comment, 8 call sites; body otherwise byte-identical). The
error-returning source (errvt/errread/errwrite/errsource) moves with
its sole consumer errorsource into scanner_test.ww; the close-recording
source (srcclosed/closevt/closesink/closewrite/closeclose/closesource)
moves with streamclosenopropagate into stream_test.ww. Line-multiset
diff old-vs-concat (heads/banners excluded, sputstr normalized): the
only residue is the 10-line putstr helper counted twice.
Consumers: Makefile LIBRARY_TESTS replaces the bufio_test.ww entry with
the two new entries in place; test/byteid/libbyteid_test.ww roster row
becomes two fx rows, NENTEXPECT 58->59.
Validation: standalone ww test lib/bufio/scanner_test.ww (13 passed)
and lib/bufio/stream_test.ww (13 passed); dir mode ww test lib/bufio
(26 passed, no duplicate symbols); byteid compile-only build exit 0,
59 roster appends == NENTEXPECT.
This commit is contained in:
@@ -43,7 +43,7 @@ import time;
|
||||
def MID: i32 = 0;
|
||||
def MDIVERGE: i32 = 1;
|
||||
def MWWREJECT: i32 = 2;
|
||||
def NENTEXPECT: i32 = 58;
|
||||
def NENTEXPECT: i32 = 59;
|
||||
|
||||
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 58-unit roster. Graduation history lives in git (the retired C
|
||||
// The 59-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 = {
|
||||
@@ -125,7 +125,8 @@ fn corpus() []ent = {
|
||||
append(es, fx("lib/time/arithm_test.ww"));
|
||||
append(es, fx("lib/time/duration_test.ww"));
|
||||
append(es, fx("lib/time/instant_test.ww"));
|
||||
append(es, fx("lib/bufio/bufio_test.ww"));
|
||||
append(es, fx("lib/bufio/stream_test.ww"));
|
||||
append(es, fx("lib/bufio/scanner_test.ww"));
|
||||
append(es, fx("lib/fmt/fmt_test.ww"));
|
||||
append(es, pr("package main;\nimport sort;\nfn main() i32 = { return 0; };\n",
|
||||
"package sort;", "lib/sort"));
|
||||
|
||||
Reference in New Issue
Block a user