diff --git a/test/wcc/781_fmt_vstream_compositions_run.c b/test/wcc/781_fmt_vstream_compositions_run.c index 72d7382e..45e4bd0c 100644 --- a/test/wcc/781_fmt_vstream_compositions_run.c +++ b/test/wcc/781_fmt_vstream_compositions_run.c @@ -19,17 +19,29 @@ * * row | what it pins * --------------------------+-------------------------------------- - * fdprintln_v_run_basic | vfprintln through an fd_ctx vstream - * | (via fdprintln_v's wired vstream sink - * | dispatching vfprint then vputbytes - * | "\n"). One i64 arg + str arg + bool - * | arg; asserts space-separator plus - * | trailing newline byte content. - * fdprintfln_v_run_fmt | vfprintfln through fd_ctx vstream - * | with a {n}-placeholder format string. + * fdprintln_v_run_basic | fdprintln_v wired vstream sink + * | (inline vfprint + vputbytes "\n"). + * | One i64 arg + str arg + bool arg; + * | asserts space-separator plus trailing + * | newline byte content. + * fdprintfln_v_run_fmt | fdprintfln_v wired vstream sink with + * | a {n}-placeholder format string. * | Asserts placeholder substitution + * | trailing newline shape (mirror of * | fmt.fprintfln, fmt.ww:740). + * vfprintln_basic | fmt.vfprintln dispatched DIRECTLY + * | through memio.fixed_vstream + read + * | back via memio.fixed_string. Pins + * | the new V-side composition symbol + * | itself (fdprintln_v open-codes the + * | same vfprint+vputbytes chain rather + * | than calling vfprintln, so without + * | this row the new symbol ships + * | uncovered). + * vfprintfln_basic | fmt.vfprintfln direct dispatch via + * | memio.fixed_vstream + fixed_string, + * | same direct-symbol rationale as + * | vfprintln_basic. * bsprintf_v_basic | vbsprintf into a caller-supplied * | [16]u8 buffer through * | memio.fixed_vstream; @@ -170,6 +182,66 @@ static const struct row rows[] = { "};\n", 61, STAGE_CS, 0 }, + { "vfprintln_basic", + "package main;\n" + "import os;\n" + "import fmt;\n" + "import io;\n" + "import memio;\n" + "export fn main() i32 = {\n" + " let buf: [16]u8;\n" + " let r: (io.vstream | nomem) = memio.fixed_vstream(buf[0:16]);\n" + " let vs: io.vstream = nil: *io.vtable;\n" + " match (r) {\n" + " case let v: io.vstream => { vs = v; };\n" + " case nomem => { return 90; };\n" + " };\n" + " let wr = fmt.vfprintln(vs, 1i64, \"hi\", true);\n" + " let nw: size = 0;\n" + " match (wr) {\n" + " case let n: size => { nw = n; };\n" + " case io.error => { return 91; };\n" + " };\n" + " if (nw != 10: size) { return 92; };\n" + " let view: str = memio.fixed_string(vs);\n" + " if (view.len != 10) { return 93; };\n" + " if (view[0] != 49u8) { return 94; };\n" + " if (view[1] != 32u8) { return 95; };\n" + " if (view[2] != 104u8 || view[3] != 105u8) { return 96; };\n" + " if (view[9] != 10u8) { return 97; };\n" + " return 64;\n" + "};\n", + 64, + STAGE_CS, 0 }, + { "vfprintfln_basic", + "package main;\n" + "import os;\n" + "import fmt;\n" + "import io;\n" + "import memio;\n" + "export fn main() i32 = {\n" + " let buf: [16]u8;\n" + " let r: (io.vstream | nomem) = memio.fixed_vstream(buf[0:16]);\n" + " let vs: io.vstream = nil: *io.vtable;\n" + " match (r) {\n" + " case let v: io.vstream => { vs = v; };\n" + " case nomem => { return 90; };\n" + " };\n" + " let wr = fmt.vfprintfln(vs, \"x={}\", 7i64);\n" + " let nw: size = 0;\n" + " match (wr) {\n" + " case let n: size => { nw = n; };\n" + " case io.error => { return 91; };\n" + " };\n" + " if (nw != 4: size) { return 92; };\n" + " let view: str = memio.fixed_string(vs);\n" + " if (view.len != 4) { return 93; };\n" + " if (view[0] != 120u8 || view[1] != 61u8) { return 94; };\n" + " if (view[2] != 55u8 || view[3] != 10u8) { return 95; };\n" + " return 65;\n" + "};\n", + 65, + STAGE_CS, 0 }, { "bsprintf_v_basic", "package main;\n" "import os;\n"