lib/test: Go external-test packages (<mod>_test); retire decimaltest (#16 PREP-a)

30 lib test files: package <mod> -> <mod>_test, the sanctioned Go-over-Hare
departure (CLAUDE.md rule-9 carve-out; white-box testing deferred, not
forbidden). decimaltest retired per .ai/rob-16-decimaltest-ruling.md: Hare
ships no decimal_test.ha (engine covered transitively); coverage migrated
losslessly into stoftest rows (all-9s carry, nd>19 pure-decimal) + ftostest
f64_roundtrip mirroring ref/hare strconv ftos_test.ha tcsf64; k=0 micro-gap
documented at site. regex_test keeps its white-box internal probes under a
documented rule-7 divergence (rehome = task #9). 922_decimal_run + its 989
byte-id row removed with the fixture.
This commit is contained in:
2026-06-10 12:11:11 +09:00
parent b795c320c9
commit 99e3393048
35 changed files with 77 additions and 306 deletions

View File

@@ -1,57 +0,0 @@
/*
* 922_decimal_run — execute the lib/strconv/test/decimaltest fixture
* under the C-side `ww run` driver and assert exit 0.
*
* Same thin-wrapper shape as 967_bytes_run / 968_utf8_run / 979_hex_run:
* decimaltest.ww carries its own `export fn main()` that drives the
* @test fns and signals which case failed via the exit code (signalled
* + 10, so cases 1..6 → exit 11..16).
*
* The test fixture lives in lib/strconv/test/ (not lib/strconv/) so
* `import strconv` resolves to the lib/strconv DIRECTORY rather than
* shadowing on the strconv.ww FILE — same-dir resolution would pull
* in only strconv.ww and miss decimal.ww + stof_data.ww. From the
* test/ subdir, the search-path lookup falls through srcd and reaches
* the libdir's directory hit, expanding the full strconv package.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
static int
runwait(const char *cmd)
{
int rc = system(cmd);
if (rc == -1) return -1;
if (WIFEXITED(rc)) return WEXITSTATUS(rc);
return 1;
}
int
main(void)
{
const char *bin = getenv("BIN");
if (!bin) bin = "out/bin";
char absbin[1024];
if (bin[0] != '/') {
char cwd[1024];
if (getcwd(cwd, sizeof cwd) == NULL) return 1;
snprintf(absbin, sizeof absbin, "%s/%s", cwd, bin);
bin = absbin;
}
char cwd[1024];
if (getcwd(cwd, sizeof cwd) == NULL) return 1;
const char *src = "lib/strconv/test/decimaltest.ww";
char path[1024], cmd[2048];
snprintf(path, sizeof path, "%s/%s", cwd, src);
snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path);
int rc = runwait(cmd);
if (rc != 0) {
fprintf(stderr, "decimal_run FAIL: %s exited %d\n", src, rc);
return 1;
}
printf("decimal_run: %s ok\n", src);
return 0;
}

View File

@@ -85,7 +85,6 @@ static const struct ent ents[] = {
{ .fixture = "lib/memio/memiotest.ww", .mode = M_ID },
{ .fixture = "lib/os/ostest.ww", .mode = M_ID },
{ .fixture = "lib/regex/regex_test.ww", .mode = M_ID },
{ .fixture = "lib/strconv/test/decimaltest.ww", .mode = M_ID },
{ .fixture = "lib/strconv/test/ftostest.ww", .mode = M_ID },
/* graduated from #59.10 DIVERGE by the #62 float-literal fold fix
* (wwstage lexer now folds through strconv.stof64, matching