lib: migrate every test file to the canonical *_test.ww name

25 renames (git mv, content untouched). _test.ww is what the package
coordinator's test detection and the sep loader's canonical exclusion
key on; the old *test.ww spellings survived only through the
line-leading-@test compatibility scan. Consumers updated in place:
LIBRARY_TESTS, the libbyteid roster, the 901/974/975/976 carriers that
copy or invoke these files, and the check.c/check.ww + path/ftos
comments that cite them. Closes the open-driver-work migration bullet.
This commit is contained in:
2026-08-08 04:29:31 +09:00
parent 634f7a2b3f
commit fa4b9a134b
34 changed files with 52 additions and 55 deletions

View File

@@ -396,23 +396,23 @@ $(BIN)/test_%: test/wcc/%.c test/wcc/wwtestpkg.h $(LIB)/libwcc.a | $(BIN)
# Native library tests execute their source owner directly. The retired C
# launchers added no assertion beyond this exit status.
LIBRARY_TESTS = lib/errors/errnotest.ww lib/ascii/asciitest.ww \
lib/ww/syntax/toktest.ww lib/ww/syntax/asttest.ww \
lib/ww/syntax/symtest.ww \
lib/strconv/test/ftostest.ww lib/strconv/test/stoftest.ww \
lib/strconv/test/inttest.ww lib/strings/stringstest.ww \
lib/bytes/bytestest.ww lib/encoding/utf8/utf8test.ww \
lib/bufio/bufiotest.ww lib/math/random/random_test.ww \
lib/math/checked/checked_test.ww lib/fmt/fmttest.ww \
lib/log/logtest.ww lib/fnmatch/fnmatchtest.ww \
lib/shlex/shlextest.ww lib/time/timetest.ww \
lib/encoding/hex/hextest.ww lib/memio/memiotest.ww \
lib/temp/temptest.ww lib/getopt/getopttest.ww \
LIBRARY_TESTS = lib/errors/errno_test.ww lib/ascii/ascii_test.ww \
lib/ww/syntax/tok_test.ww lib/ww/syntax/ast_test.ww \
lib/ww/syntax/sym_test.ww \
lib/strconv/test/ftos_test.ww lib/strconv/test/stof_test.ww \
lib/strconv/test/int_test.ww lib/strings/strings_test.ww \
lib/bytes/bytes_test.ww lib/encoding/utf8/utf8_test.ww \
lib/bufio/bufio_test.ww lib/math/random/random_test.ww \
lib/math/checked/checked_test.ww lib/fmt/fmt_test.ww \
lib/log/log_test.ww lib/fnmatch/fnmatch_test.ww \
lib/shlex/shlex_test.ww lib/time/time_test.ww \
lib/encoding/hex/hex_test.ww lib/memio/memio_test.ww \
lib/temp/temp_test.ww lib/getopt/getopt_test.ww \
lib/encoding/base32/base32_test.ww \
lib/encoding/base64/base64_test.ww \
lib/hash/adler32/adler32_test.ww lib/hash/crc16/crc16_test.ww \
lib/hash/crc32/crc32_test.ww lib/hash/crc64/crc64_test.ww \
lib/path/pathtest.ww lib/crypto/sha256/sha256_test.ww \
lib/path/path_test.ww lib/crypto/sha256/sha256_test.ww \
lib/hash/siphash/siphash_test.ww
# These real sources have a standalone-compilation contract that is not

View File

@@ -2900,7 +2900,7 @@ src_imports(Node *file, const char *modtag, const char *name)
if (file == NULL || name == NULL || name[0] == '\0') return 0;
for (Node *u = file->list; u; u = u->next) {
if (u->kind != N_USE) continue;
/* Skip self-imports: lib/fmt/fmttest.ww carries `use fmt;`
/* Skip self-imports: lib/fmt/fmt_test.ww carries `use fmt;`
* even though its module tag is also "fmt"; that directive
* doesn't introduce a foreign module bareword and lib/fmt's
* own `fn bsprintf(fmt: str, ...)` is not a shadow of it. */

View File

@@ -310,9 +310,6 @@ drift:
single-threaded by design today).
- A package-level `-o` contract (single-file `ww test -o` exists; directory
packages publish fixed `<package>.test` stems under `-c`).
- Universal `*_test.ww` filename migration for library tests (several
library suites still use the older `*test.ww` names, enumerated by
`LIBRARY_TESTS` and the `989_lib_byteid` roster).
- The remaining invalid-`@test` attribute-shape diagnostics (exported
tests, prototypes, arguments, variadics, non-void returns, duplicate
annotations) with stable text in both frontends.

View File

@@ -1,5 +1,5 @@
// pathtest — exercises lib/path (c2-stack subset). Run with
// `out/bin/ww run lib/path/pathtest.ww`. A failing row aborts via the
// `out/bin/ww run lib/path/path_test.ww`. A failing row aborts via the
// assert/abort builtin (task #5 @test conversion).
//
// Vectors mirror Hare's @test fns in ref/hare/path/stack.ha:77-119
@@ -7,7 +7,7 @@
// to c3 (abs/local unimplemented); only the relative rows run here.
//
// Parallel `[N]str` row arrays (rather than `[N]struct{...}`) sidestep
// the cstage cgen chained `arr[i].field` store gap (getopttest.ww:6).
// the cstage cgen chained `arr[i].field` store gap (getopt_test.ww:6).
// push is stateful, so each row is applied in sequence to one buffer;
// the table holds {segment, expected-string} pairs (stack.ha:36-42 is
// the normalization spec these rows encode).

View File

@@ -1,5 +1,5 @@
// ftostest — exercises lib/strconv/ftos.ww (Hare ftos.ha / ftos_ryu.ha
// Ryū port). Run with `out/bin/ww run lib/strconv/test/ftostest.ww`.
// Ryū port). Run with `out/bin/ww run lib/strconv/test/ftos_test.ww`.
// A failing row aborts via the assert/abort builtin (task #5 @test
// conversion).
//

View File

@@ -218,7 +218,7 @@ fn srcimports(file: *syntax.node, modtag: str, name: str) bool = {
let u: *syntax.node = file.list;
for (u != nil) {
if (u.kind == syntax.nkind.N_USE) {
// Skip self-imports: lib/fmt/fmttest.ww carries
// Skip self-imports: lib/fmt/fmt_test.ww carries
// `use fmt;` while its module tag is also "fmt".
// That directive doesn't introduce a foreign
// module bareword and lib/fmt's own

View File

@@ -104,12 +104,12 @@ fn corpus() []ent = {
for (z < es.len) { zeroent(&es[z]); z += 1; };
let n: i32 = 0;
let k: *i32 = &n;
fx(es, k, "lib/bytes/bytestest.ww");
fx(es, k, "lib/dirs/dirstest.ww");
fx(es, k, "lib/bytes/bytes_test.ww");
fx(es, k, "lib/dirs/dirs_test.ww");
fx(es, k, "lib/encoding/base32/base32_test.ww");
fx(es, k, "lib/encoding/hex/hextest.ww");
fx(es, k, "lib/encoding/utf8/utf8test.ww");
fx(es, k, "lib/getopt/getopttest.ww");
fx(es, k, "lib/encoding/hex/hex_test.ww");
fx(es, k, "lib/encoding/utf8/utf8_test.ww");
fx(es, k, "lib/getopt/getopt_test.ww");
fx(es, k, "lib/hash/adler32/adler32_test.ww");
fx(es, k, "lib/hash/crc16/crc16_test.ww");
fx(es, k, "lib/hash/crc32/crc32_test.ww");
@@ -117,19 +117,19 @@ fn corpus() []ent = {
fx(es, k, "lib/hash/siphash/siphash_test.ww");
fx(es, k, "lib/math/checked/checked_test.ww");
fx(es, k, "lib/math/random/random_test.ww");
fx(es, k, "lib/memio/memiotest.ww");
fx(es, k, "lib/os/ostest.ww");
fx(es, k, "lib/memio/memio_test.ww");
fx(es, k, "lib/os/os_test.ww");
pr(es, k, "package main;\nimport os.exec;\nfn main() i32 = { return 0; };\n",
"package exec;", "lib/os/exec");
fx(es, k, "lib/regex/regex_test.ww");
fx(es, k, "lib/strconv/test/ftostest.ww");
fx(es, k, "lib/strconv/test/stoftest.ww");
fx(es, k, "lib/strconv/test/inttest.ww");
fx(es, k, "lib/strings/stringstest.ww");
fx(es, k, "lib/temp/temptest.ww");
fx(es, k, "lib/time/timetest.ww");
fx(es, k, "lib/bufio/bufiotest.ww");
fx(es, k, "lib/fmt/fmttest.ww");
fx(es, k, "lib/strconv/test/ftos_test.ww");
fx(es, k, "lib/strconv/test/stof_test.ww");
fx(es, k, "lib/strconv/test/int_test.ww");
fx(es, k, "lib/strings/strings_test.ww");
fx(es, k, "lib/temp/temp_test.ww");
fx(es, k, "lib/time/time_test.ww");
fx(es, k, "lib/bufio/bufio_test.ww");
fx(es, k, "lib/fmt/fmt_test.ww");
pr(es, k, "package main;\nimport sort;\nfn main() i32 = { return 0; };\n",
"package sort;", "lib/sort");
pr(es, k, "package main;\nimport path;\nfn main() i32 = { return 0; };\n",
@@ -154,17 +154,17 @@ fn corpus() []ent = {
// from the retired 815/940/951 driver-parity carriers. No
// sentinel: there is no dep unit to prove.
pr(es, k, "package main;\nfn main() i32 = { return 0; };\n", "", "");
fx(es, k, "lib/ascii/asciitest.ww");
fx(es, k, "lib/ascii/ascii_test.ww");
fx(es, k, "lib/encoding/base64/base64_test.ww");
fx(es, k, "lib/errors/errnotest.ww");
fx(es, k, "lib/log/logtest.ww");
fx(es, k, "lib/os/stattest.ww");
fx(es, k, "lib/errors/errno_test.ww");
fx(es, k, "lib/log/log_test.ww");
fx(es, k, "lib/os/stat_test.ww");
// toktest/asttest resolve `import syntax` via -I lib/ww, cf 905
fxi(es, k, "lib/ww/syntax/toktest.ww", "lib/ww");
fxi(es, k, "lib/ww/syntax/asttest.ww", "lib/ww");
fxi(es, k, "lib/ww/syntax/tok_test.ww", "lib/ww");
fxi(es, k, "lib/ww/syntax/ast_test.ww", "lib/ww");
fx(es, k, "lib/crypto/sha256/sha256_test.ww");
fx(es, k, "lib/fnmatch/fnmatchtest.ww");
fx(es, k, "lib/shlex/shlextest.ww");
fx(es, k, "lib/fnmatch/fnmatch_test.ww");
fx(es, k, "lib/shlex/shlex_test.ww");
assert(n == NENTEXPECT);
return es;
};

View File

@@ -151,7 +151,7 @@ main(void)
"B fn-ptr struct-field call", 0, 1 },
{ "lib/encoding/utf8/utf8.ww",
"C abort intrinsic callee", 0, 1 },
{ "lib/fnmatch/fnmatchtest.ww",
{ "lib/fnmatch/fnmatch_test.ww",
"D module-leaf == type/fn name", 0, 1 },
{ "lib/math/random/random_test.ww",
"D module-leaf == type/fn name", 0, 1 },

View File

@@ -2,13 +2,13 @@
* 974_getenv_run — execute the lib/os getenv smoke fixture under the
* C-side `ww run` driver and assert exit 0.
*
* Pre-arranges the environment that lib/os/ostest.ww asserts against:
* Pre-arranges the environment that lib/os/os_test.ww asserts against:
*
* WW_TEST_GETENV = "hello-world" (set, non-empty)
* WW_TEST_EMPTY = "" (set, empty value)
* WW_TEST_NOT_SET unset (unsetenv-cleared)
*
* The child `ww run` process inherits this env, so ostest.ww's
* The child `ww run` process inherits this env, so os_test.ww's
* `os.getenv` calls see exactly the state we configured here. This
* is the "C-side env arrangement" pattern (parent sets, child reads)
* — proper POSIX shape for stdlib testing without a `setenv` ww
@@ -46,12 +46,12 @@ main(void)
char cwd[1024];
if (getcwd(cwd, sizeof cwd) == NULL) return 1;
/* Pre-arrange the env state ostest.ww asserts against. */
/* Pre-arrange the env state os_test.ww asserts against. */
setenv("WW_TEST_GETENV", "hello-world", 1);
setenv("WW_TEST_EMPTY", "", 1);
unsetenv("WW_TEST_NOT_SET");
const char *src = "lib/os/ostest.ww";
const char *src = "lib/os/os_test.ww";
char path[1024], cmd[2048];
snprintf(path, sizeof path, "%s/%s", cwd, src);
snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path);

View File

@@ -5,9 +5,9 @@
* Workflow:
* 1. mkdtemp /tmp/wwdirs-XXXXXX — fresh per run, no cross-run
* stale state, no parallel-test conflicts.
* 2. setenv the four cohort env states (see lib/dirs/dirstest.ww
* 2. setenv the four cohort env states (see lib/dirs/dirs_test.ww
* file header for the contract).
* 3. exec `ww test lib/dirs/dirstest.ww`. The fixture reads
* 3. exec `ww test lib/dirs/dirs_test.ww`. The fixture reads
* WW_TEST_TMPDIR + the XDG_/HOME envs and asserts.
* 4. Remove the exact auto-created child dirs bottom-up, then the
* mkdtemp-owned root.
@@ -63,7 +63,7 @@ main(void)
unsetenv("XDG_STATE_HOME");
setenv("WW_TEST_TMPDIR", tmpl, 1);
const char *src = "lib/dirs/dirstest.ww";
const char *src = "lib/dirs/dirs_test.ww";
char path[1024], cmd[2048];
snprintf(path, sizeof path, "%s/%s", cwd, src);
snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path);

View File

@@ -10,9 +10,9 @@
* <tmp>/symlink → ./regfile (relative symlink)
* <tmp>/subdir directory, mode 0700
* 3. setenv WW_TEST_STAT_REGFILE / SYMLINK / SUBDIR / NOENT with
* the absolute paths; lib/os/stattest.ww reads them via
* the absolute paths; lib/os/stat_test.ww reads them via
* os.getenv and exercises stat/lstat/fstat/exists.
* 4. exec `ww test lib/os/stattest.ww`.
* 4. exec `ww test lib/os/stat_test.ww`.
* 5. Remove the exact children and then the mkdtemp-owned root.
*
* Same wrapper shape as 970-975; cleanup runs on success and failure.
@@ -62,7 +62,7 @@ main(void)
snprintf(symlink_path, sizeof symlink_path, "%s/symlink", tmpl);
snprintf(subdir, sizeof subdir, "%s/subdir", tmpl);
snprintf(noent, sizeof noent, "%s/does-not-exist", tmpl);
const char *src = "lib/os/stattest.ww";
const char *src = "lib/os/stat_test.ww";
int fail = 0, subdir_owned = 0;
/* Populate. */