test: prove declared package import semantics

This commit is contained in:
2026-08-14 03:08:16 +09:00
parent 6efe9b70d4
commit a841278333
11 changed files with 1001 additions and 131 deletions

View File

@@ -220,8 +220,8 @@ export fn occurrences(haystack: str, needle: str) i32 = {
// Expected semantic identity for a canonical absolute directory that is not
// representable below an active source root. Keep this independent observer
// byte-for-byte aligned with the documented driver protocol.
export fn localpackageidentity(dir: str, leaf: str) str = {
let out: []u8 = alloc([], (dir.len * 4 + leaf.len + 16): u64)!;
export fn localpackageidentity(dir: str, declaredname: str) str = {
let out: []u8 = alloc([], (dir.len * 4 + 16): u64)!;
let prefix: str = "__wwlocal.p";
let i: i32 = 0;
for (i < prefix.len) { append(out, prefix[i]); i += 1; };
@@ -244,9 +244,6 @@ export fn localpackageidentity(dir: str, leaf: str) str = {
};
i += 1;
};
append(out, '.');
i = 0;
for (i < leaf.len) { append(out, leaf[i]); i += 1; };
return strings.frombytes(out);
};