test: remove package-wide import assumptions

This commit is contained in:
2026-08-14 03:45:02 +09:00
parent a841278333
commit 04d9560d51
74 changed files with 121 additions and 154 deletions

View File

@@ -7,12 +7,12 @@ package sepbuild_test;
// remains live.
//
// sepbuild (#46 commit-3) — build_one_sep END-TO-END on the real lib
// chain root -> os -> {rt,time} (transitive-closure discovery + topo):
// build+run exit 7 both stages; {time,rt,os,__root}.wwi/.a
// chain root -> os -> time (transitive-closure discovery + topo):
// build+run exit 7 both stages; {time,os,__root}.wwi/.a
// materialize; per-package .s/.wwi/.a/.unit.ww and the final binary
// byte-id cs vs ww; every .unit.ww is the package's own sorted source
// set; `ww run` routes through the same sole sep path (exit 7 both
// stages).
// set; the runtime remains a fixed linker input rather than a source graph
// action; `ww run` routes through the same sole sep path (exit 7 both stages).
//
// seproot — a ROOT whose `export fn use(a: *t)` reaches an unexported
// local `type t` builds and emits a deterministic self-contained .wwi/.a.
@@ -89,7 +89,7 @@ fn samefile(label: str, what: str, a: str, b: str) void = {
};
// discovery/topo: every reachable package action materialized.
let pkgs: []str = ["time", "rt", "os", "__root"];
let pkgs: []str = ["time", "os", "__root"];
let i: i32 = 0;
for (i < pkgs.len) {
if (!testenv.exists(strings.concat(td, "/prog.cs.sepwork/",

View File

@@ -18,12 +18,10 @@ package sepimport_test;
// emitting a bare `TEXT main` that collides with the root entry;
// EXACTLY one column-0 `TEXT main,` across the whole sep build.
//
// declns (#23/#30 modfn leg) — a value-namespace `fn aa` coexists
// with an imported MODULE aa (exit 6 = aa() + aa.helper()); the _vbu
// layout flips decl order and must stay byte-identical on
// {aa.s,aa.wwi,__root.s} (silent order-dependence in the SK_USE/value
// promote is the regression); __root.s carries BOTH
// `CALL aa.helper(SB)` and `CALL main.aa(SB)`.
// declns (#23/#30 modfn leg) — a distinct local `fn localaa` and the
// file-scoped imported qualifier aa both resolve (exit 6 = localaa() +
// aa.helper()); the _vbu layout flips declaration/import order and must stay
// byte-identical on {aa.s,aa.wwi,__root.s}; __root.s carries both calls.
//
// slttypepref (#58/#50 c1) — scopelookuptype must prefer the current
// module's SK_TYPE when a param shadows a type leaf two modules both
@@ -204,7 +202,7 @@ fn depmainrow(label: str, entry: str, want: i32, deps: str,
if (runcode(td, strings.concat("r_", labs[l], "_", tags[s]),
rav) != 6) {
fail(labs[l], strings.concat(drvs[s],
" exit != 6 (coexistence mis-resolved)"));
" exit != 6 (qualified/local resolution failed)"));
};
s += 1;
};
@@ -264,9 +262,9 @@ fn depmainrow(label: str, entry: str, want: i32, deps: str,
fail("declns", strings.concat("__root.s (", tags[t2],
") lacks module-qualified `CALL aa.helper(SB)`"));
};
if (!testenv.has(rs, "CALL\tmain.aa(SB)")) {
if (!testenv.has(rs, "CALL\tmain.localaa(SB)")) {
fail("declns", strings.concat("__root.s (", tags[t2],
") lacks local-fn `CALL main.aa(SB)`"));
") lacks local-fn `CALL main.localaa(SB)`"));
};
t2 += 1;
};
@@ -287,11 +285,13 @@ fn sltbuild(drv: str, param: str) i32 = {
"import xa;\n",
"export type invalid = !i64;\n",
"export fn f(", param,
": i32) i64 = { return size(invalid): i64; };\n"));
": i32) i64 = {\n",
"\tlet foreign: i64 = size(xa.invalid): i64;\n",
"\treturn (size(invalid): i64) + foreign - foreign;\n",
"};\n"));
testenv.writefile(strings.concat(dir, "/root.ww"), strings.concat(
"package main;\n",
"import xb;\n",
"import xa;\n",
"fn main() int = { return xb.f(0): int; };\n"));
let bav: []str = [testenv.driver(drv), "build", "root.ww"];
let brc: i32 = runcode(dir, "build", bav);