ww: finish initialization validation parity

This commit is contained in:
2026-08-14 20:03:11 +09:00
parent 25da54936d
commit c59a7c11de
26 changed files with 528 additions and 143 deletions

View File

@@ -93,17 +93,26 @@ fn samefile(a: str, b: str, why: str) void = {
"example.foo.unit.ww"));
let wantfoo: str = strings.concat("//ww:module-reset example.foo\n", afoosrc,
"\n//ww:module-reset example.foo\n", zfoosrc, "\n");
if (!testenv.same(foounit, wantfoo)
let foovoucher: str = "//ww:direct-export example.bar ";
if (!strings.hasprefix(foounit, wantfoo)
|| testenv.occurrences(foounit, "//ww:direct-export ") != 1
|| testenv.occurrences(foounit, foovoucher) != 1
|| testenv.pos(foounit, foovoucher) != wantfoo.len
|| testenv.has(foounit, "DECOY_FILE")
|| testenv.has(foounit, "//ww:module ")) {
fail("foo unit is not exactly its sorted, owned source set");
fail("foo owner prefix/direct-export voucher mismatch");
};
let wantroot: str = strings.concat("//ww:module-reset ", appidentity,
"\n", appsrc,
"\n");
if (!testenv.same(wantroot, testenv.readfile(strings.concat(cwork,
appidentity, ".unit.ww")))) {
fail("root unit is not exactly its owned source");
let rootunit: str = testenv.readfile(strings.concat(cwork,
appidentity, ".unit.ww"));
let rootvoucher: str = "//ww:direct-export example.foo ";
if (!strings.hasprefix(rootunit, wantroot)
|| testenv.occurrences(rootunit, "//ww:direct-export ") != 1
|| testenv.occurrences(rootunit, rootvoucher) != 1
|| testenv.pos(rootunit, rootvoucher) != wantroot.len) {
fail("root owner prefix/direct-export voucher mismatch");
};
let keys: []str = ["example.base", "example.bar", "example.foo",
appidentity];