test: prove platform filename selection

This commit is contained in:
2026-08-14 21:44:26 +09:00
parent f138844737
commit 5c0e468f53
4 changed files with 857 additions and 34 deletions

View File

@@ -255,6 +255,20 @@ ImportPath = ident { "." ident } .
`.ww` files sharing one declared package name compiles as one package. The
declared name need not equal the directory name or the final component of its
canonical import identity.
- Directory source eligibility uses Go 1.26.5 filename suffix semantics for
WW's fixed `linux/amd64` target. In the basename stem before the first dot, a
final `_test` token is ignored for platform matching. A final known OS or
architecture token must match `linux` or `amd64`; a final known OS followed
by a known architecture takes precedence and both must match. The known-name
sets are Go 1.26.5's `syslist.KnownOS` and `syslist.KnownArch`. Unknown or
misplaced suffixes are ordinary, and a platform word without a nonempty
underscore prefix is ordinary (`linux.ww` and `plan9_test.ww` are selected;
`x_windows.ww` and `x_plan9_test.ww` are not). Leading-dot/underscore entries
are ignored. Eligible names are byte-sorted before source validation.
Production excludes selected `*_test.ww`; test variants classify only those
selected test files. An excluded file contributes no declarations, imports,
package edge, action, export, artifact, initialization, test, or persistent
invalidation.
- `import acme.codec;` loads the canonical package `acme.codec`. If that
package declares `package wire;`, the importing file sees its exported names
as `wire.Name`; `codec.Name` is not an additional binding. An explicit alias