ww: finish initialization validation parity
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user