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

@@ -13,8 +13,9 @@ package collide_test;
// global), so a single-file fixture cannot express it.
//
// barefn (#84/#24a) — a `package main;` root `fn run` coexists with
// imported aa.run: build+run exit 9 on BOTH stages (the user's
// main.run wins, never aa.run=5); the concatenated
// imported aa.run: build+run exit 9 on BOTH stages while an explicit
// `aa.run()` use keeps the source import real; the user's unqualified
// `run()` resolves to main.run, never aa.run=5. The concatenated
// __root.s+aa.s (fixed #93 sep order) carries EXACTLY ONE
// `TEXT main.run,` and EXACTLY ONE `TEXT aa.run,` (distinct symbols,
// no #31-class w6l-tolerated duplicate, no silently-dead bare fn);
@@ -65,7 +66,8 @@ fn runcode(dir: str, name: str, argv: []str) i32 = {
"import bar;\n",
"let slot: i64 = 7;\n",
"let fp: *i64 = &slot;\n",
"export fn main() int = { return (*fp): int; };\n"));
"export fn main() int = { let _ = bar.slot(); ",
"return (*fp): int; };\n"));
let av: []str = [testenv.driver(drvs[i]), "build", "-I", "bar",
"main.ww"];
if (runcode(td, strings.concat("build_", drvs[i]), av) == 0) {
@@ -102,7 +104,10 @@ fn textcount(s: str, sym: str) i32 = {
"package main;\n",
"import aa;\n",
"fn run() i32 = { return 9; };\n",
"export fn main() i32 = { return run(); };\n"));
"export fn main() i32 = {\n",
"\tlet foreign: i32 = aa.run();\n",
"\treturn run() + foreign - foreign;\n",
"};\n"));
let drvs: []str = ["ww", "ww_ww"];
let tags: []str = ["cs", "ww"];
let asms: []str = ["", ""];