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:
2026-08-08 17:32:16 +09:00
parent 854a532feb
commit 291860ddef
4 changed files with 476 additions and 510 deletions

View File

@@ -493,7 +493,8 @@ LIBRARY_TESTS = lib/errors/errno_test.ww lib/ascii/ascii_test.ww \
lib/bytes/trim_test.ww lib/encoding/utf8/rune_test.ww \
lib/encoding/utf8/encode_test.ww lib/encoding/utf8/decode_test.ww \
lib/encoding/utf8/types_test.ww \
lib/bufio/bufio_test.ww lib/math/random/random_test.ww \
lib/bufio/stream_test.ww lib/bufio/scanner_test.ww \
lib/math/random/random_test.ww \
lib/math/checked/checked_test.ww lib/fmt/fmt_test.ww \
lib/log/log_test.ww lib/log/silent_test.ww lib/fnmatch/fnmatch_test.ww \
lib/shlex/shlex_test.ww lib/time/arithm_test.ww \