lib: split strings suffix/contains/index/compare tests per ref/hare/strings

Pure move: the hasprefix/hassuffix, contains, byteindex/rbyteindex/
index/rindex, and compare sections of strings_test.ww become sibling
suffix_test.ww, contains_test.ww, index_test.ww, compare_test.ww,
mirroring ref/hare/strings/{suffix,contains,index,compare}.ha
ownership. Blocks are byte-identical; only the section banner lines
are deleted (the file names now carry them).

The remaining families (dup, concat, trim, sub, utf8, iter, tokenize,
pad, replace, cut) stay in strings_test.ww: they all consume the
file-local streq helper, and a helper cannot be shared across split
test files — a single-file test root does not pull same-package
siblings (undefined: helper), while dir-mode composes all package
test files into one unit (duplicate fn helper). Splitting them would
force either helper duplication or renames, both out of scope for a
pure move.

Consumers: Makefile LIBRARY_TESTS gains the four new entries beside
the strings_test.ww row; test/byteid/libbyteid_test.ww roster gains
four fx rows, NENTEXPECT 44->48 (+4).
This commit is contained in:
2026-08-08 16:39:04 +09:00
parent 8539343de4
commit 8a1dc641e3
7 changed files with 329 additions and 304 deletions

View File

@@ -43,7 +43,7 @@ import time;
def MID: i32 = 0;
def MDIVERGE: i32 = 1;
def MWWREJECT: i32 = 2;
def NENTEXPECT: i32 = 47;
def NENTEXPECT: i32 = 51;
type ent = struct {
fixture: str, // repo-relative .ww; "" -> probe entry
@@ -83,7 +83,7 @@ fn pri(p: str, inc: str, sentinel: str, moddir: str) ent = {
return e;
};
// The 46-unit roster. Graduation history lives in git (the retired C
// The 51-unit roster. Graduation history lives in git (the retired C
// carrier's table comments); cites are kept only where a non-ID pin
// would need them.
fn corpus() []ent = {
@@ -110,6 +110,10 @@ fn corpus() []ent = {
append(es, fx("lib/strconv/test/stof_test.ww"));
append(es, fx("lib/strconv/test/int_test.ww"));
append(es, fx("lib/strings/strings_test.ww"));
append(es, fx("lib/strings/suffix_test.ww"));
append(es, fx("lib/strings/contains_test.ww"));
append(es, fx("lib/strings/index_test.ww"));
append(es, fx("lib/strings/compare_test.ww"));
append(es, fx("lib/temp/temp_test.ww"));
append(es, fx("lib/time/arithm_test.ww"));
append(es, fx("lib/time/duration_test.ww"));