lib: banner purge + WHY-only comment sweep (rule 8)

Every // ---- section banner dies (132 -> 0): names carry the WHAT.
Narration deleted (filename restatements, run-with lines, what-the-
next-line-does); every ref/hare cite, task cite, divergence, ABI/
layout contract, and ownership qualifier kept (borrowed-view lines
restored where the sweep over-cut). Comment-only proven: all 442
walk-workdir .s and 32 import-probe .s byte-identical before/after;
libbyteid 56-roster all-ID.
This commit is contained in:
2026-08-08 21:10:18 +09:00
parent 659e859f34
commit aadc6618f0
90 changed files with 259 additions and 919 deletions

View File

@@ -1,9 +1,7 @@
// base64_test — exercises lib/encoding/base64's io-streaming surface.
// Run with `out/bin/ww run lib/encoding/base64/base64_test.ww`. Mirrors
// Hare's base64 @test fns (ref/hare/encoding/base64/base64.ha:315,514,
// 601) over the RFC 4648 §10 vectors, table-driven (parallel arrays;
// tuple-row arrays are blocked by #111). A failing row aborts via the
// assert/abort builtin (task #5 @test conversion).
// Mirrors Hare's base64 @test fns (ref/hare/encoding/base64/base64.ha:
// 315,514,601) over the RFC 4648 §10 vectors, table-driven (parallel
// arrays; tuple-row arrays are blocked by #111). A failing row aborts
// via the assert/abort builtin (task #5 @test conversion).
//
// The streaming decoder (newdecoder) is deferred (#247-sibling), so the
// decode side is exercised through decodestr only.
@@ -60,8 +58,6 @@ fn inval_check(enc: *base64.encoding, encoded: str) void = {
};
};
// ---- RFC 4648 §10 vectors, encode + decodestr round-trip ----
//
// Inputs are the prefixes of "foobar". The §10 expected encodings
// contain no '+' / '/', so std and base64url agree on these vectors —
// both alphabets are driven over the same table here; the std-vs-url
@@ -91,8 +87,6 @@ fn inval_check(enc: *base64.encoding, encoded: str) void = {
};
};
// ---- std vs base64url alphabet distinctness ----
//
// [0xFB, 0xFF, 0xBF] hits the 62/63 alphabet slots: std emits '+'/'/',
// url emits '-'/'_'. The two encodings must differ, each round-trips
// under its own alphabet, and each is INVALID under the other (std
@@ -112,8 +106,6 @@ fn inval_check(enc: *base64.encoding, encoded: str) void = {
inval_check(&base64.url_encoding, s_std);
};
// ---- decodestr error cases ---- ref/hare/encoding/base64/base64.ha:525
//
// Table-driven (parallel-array idiom; tuple rows blocked by #111). Each
// row exercises one malformed class the hand-written validation in
// decodestr must reject. Cross-alphabet chars are covered separately by
@@ -142,8 +134,6 @@ fn inval_check(enc: *base64.encoding, encoded: str) void = {
};
};
// ---- size calc ---- ref/hare/encoding/base64/base64.ha:601
@test fn sizes() void = {
assert(!(base64.encodedsize(0) != 0));
assert(!(base64.encodedsize(1) != 4));
@@ -172,8 +162,6 @@ fn inval_check(enc: *base64.encoding, encoded: str) void = {
base64.decodedsize(5i32);
};
// ---- round-trip every byte value 0..255 (std + url) ----
@test fn roundtrip_all_bytes() void = {
let src: [256]u8;
let i: i32 = 0;