ww: lib tests run via -T test mode; bare mains retired (closes @test conversion)

'ww test' gains the istest build path (-T injection in build_one/
buildone) and do_test/dotest accept -I, mirroring do_run - both twins.
The 35 converted lib tests drop their interim bare mains (-T
synthesizes the entry from @test fns and rejects a user main); their
35 C run-drivers flip 'ww run' -> 'ww test'; 989_lib_byteid compiles
lib tests under -T (8 user-main probe fixtures stay non-T, gated on
the fixture field). Abort-on-first-failure stands until the deferred
record-and-continue harness lands with the multi-package arc.
This commit is contained in:
2026-06-10 20:45:46 +09:00
parent 5b212e51cf
commit 2338ea5d59
74 changed files with 178 additions and 670 deletions

View File

@@ -65,9 +65,3 @@ fn checkbuf(in: str, lo: str, up: str) void = {
case nomem => void;
};
};
export fn main() i32 = {
strfold_cases();
strfold_buf_cases();
return 0;
};

View File

@@ -859,29 +859,3 @@ fn errsource() io.stream = {
};
bufio.finish(&sc);
};
export fn main() i32 = {
scanbytecases();
scanlinecases();
scanlineoverflow();
scanbytescases();
emptystream();
errorsource();
boundarycases();
multifill();
streamsmallwrite();
streamautoflush();
streamlineflush();
streamflushonwrite();
streamisbuffered();
streamunread();
streamscannerunread();
streamflushempty();
streamcloseflushes();
streamsetflushcustom();
scanrunecases();
scanruneinvalid();
newscannergrow();
newscanneroverflow();
return 0;
};

View File

@@ -810,27 +810,3 @@ fn expect_tok(toks: [][]u8, i: i32, want: []u8) void = {
assert(!(!bytes.equal(b4, h[0:6])));
assert(!(!bytes.equal(a4, z[0:0])));
};
export fn main() i32 = {
equal_cases();
index_byte_cases();
index_slice_cases();
rindex_byte_cases();
rindex_slice_cases();
contains_cases();
hasprefix_cases();
hassuffix_cases();
tokenize_cases();
rtokenize_cases();
peek_token_cases();
remaining_tokens_cases();
splitn_cases();
rsplitn_cases();
split_cases();
ltrim_cases();
rtrim_cases();
trim_cases();
cut_cases();
rcut_cases();
return 0;
};

View File

@@ -123,13 +123,3 @@ fn check(msg: []u8, want: str) void = {
assert(!(hash.sz(h) != 32: size));
assert(!(hash.bsz(h) != 64: size));
};
export fn main() i32 = {
empty();
abc();
twoblockpad();
millionas();
reentrant();
sizes();
return 0;
};

View File

@@ -129,11 +129,3 @@ fn gettmpdir() str = {
let got = dirs.state("myapp");
assert(!(!streq(got, exp)));
};
export fn main() i32 = {
test_config_xdg_set();
test_cache_xdg_relative_fallback();
test_data_unset_fallback();
test_state_unset_fallback();
return 0;
};

View File

@@ -145,13 +145,3 @@ fn enchexvec(input: str, expect: str) void = {
assert(!(base32.decodedsize(8) != 5));
assert(!(base32.decodedsize(16) != 10));
};
export fn main() i32 = {
rfc4648_std();
rfc4648_decode();
rfc4648_hex();
roundtrip_all_quintets();
invalid_inputs();
sizes();
return 0;
};

View File

@@ -188,13 +188,3 @@ fn inval_check(enc: *base64.encoding, encoded: str) void = {
case let e: errors.invalid => abort();
};
};
export fn main() i32 = {
rfc4648_std();
rfc4648_url();
urlsafe_distinct();
decode_invalid();
sizes();
roundtrip_all_bytes();
return 0;
};

View File

@@ -154,20 +154,3 @@ fn cafebabe() [8]u8 = {
case let e: errors.invalid => abort();
};
};
export fn main() i32 = {
encodestr_basic();
encodestr_zero();
encodestr_ff();
encodestr_empty();
encode_stream();
decodestr_lower();
decodestr_upper();
decodestr_mixed();
decodestr_empty();
decodestr_odd();
decodestr_bad();
decodestr_bad_mid();
roundtrip_all_bytes();
return 0;
};

View File

@@ -614,43 +614,3 @@ fn streq(a: str, b: str) bool = {
i += 1;
};
};
export fn main() i32 = {
runesz_ranges();
utf8sz_classify();
encode_ascii();
encode_two_byte();
encode_three_byte();
encode_four_byte();
decode_one_byte();
decode_two_byte();
decode_three_byte();
decode_four_byte();
decode_surrogate();
decode_overlong();
decode_out_of_range();
decode_bad_continuation();
decode_max_in_range();
decode_truncated();
decode_done();
validate_mixed_ok();
validate_malformed();
validate_empty_ok();
roundtrip();
prev_done_at_start();
prev_one_byte();
prev_two_byte();
prev_three_byte();
prev_four_byte();
prev_mixed_roundtrip();
prev_continuation_only_more();
prev_incomplete_invalid();
prev_surrogate_invalid();
prev_overlong_invalid();
prev_extracont_invalid();
prev_max_in_range();
prev_min_out_of_range();
remaining_slice_position();
strerror_cases();
return 0;
};

View File

@@ -104,10 +104,3 @@ fn errtag(e: errors.error) int = {
assert(!(!streq(os.strerror(os.EINVAL), "Invalid argument")));
assert(!(!streq(os.strerror(5), "Unknown error")));
};
export fn main() i32 = {
mapping();
opaquetail();
strerrortext();
return 0;
};

View File

@@ -631,50 +631,3 @@ fn errsource() io.stream = {
assert(!(!streq(r, "1.5 -2.5")));
os.free(r.ptr: *void, r.len: u64);
};
export fn main() i32 = {
fprintbarestr();
fprintintstr();
fprintboolrune();
fprintempty();
fprintlnmulti();
fprintlnempty();
fprintfixedshort();
fprintclosed();
fprintf_implicit();
fprintf_indexed();
fprintf_literal_braces();
fprintf_width_right();
fprintf_width_left();
fprintf_width_center();
fprintf_pad_underscore();
fprintf_base_hex();
fprintf_base_oct_bin();
fprintf_prec_int();
fprintf_prec_str_trunc();
fprintf_sign_neg();
fprintfln_basic();
fprintf_closed();
bsprintf_basic();
fprintf_bool_rune();
bsprintf_trunc();
bsprintf_width_trunc();
asprintf_basic();
asprintf_growth();
asprintf_empty();
asprintf_indexed_mods();
fprintf_f64_basic();
fprintf_f64_int_valued();
fprintf_f64_neg();
fprintf_f64_zero();
fprintf_f64_small_frac();
fprintf_f64_huge();
fprintf_f64_sign_plus();
fprintf_f64_sign_space();
fprintf_f64_width_right();
fprintf_f64_width_left();
fprint_f64_variadic();
bsprintf_f64();
asprintf_f64();
return 0;
};

View File

@@ -247,15 +247,3 @@ fn check(pat: str, s: str, expected: bool, flags: i32) void = {
let nesc: i32 = 2; // NOESCAPE
check("a\\*.c", "a*.c", false, nesc);
};
export fn main() i32 = {
basic();
brackets();
ctype();
period();
noescape();
musl_basic();
pathname();
combined();
return 0;
};

View File

@@ -476,17 +476,3 @@ fn streq(a: str, b: str) bool = {
i += 1;
};
};
export fn main() i32 = {
flagcluster();
paramflag();
separator();
repeatedflag();
baredash();
errortable();
strerrortext();
nooptionsbare();
printusage_cases();
printhelp_cases();
return 0;
};

View File

@@ -43,12 +43,3 @@ fn check(s: str, want: u32) void = {
check("'The central enemy of reliability is complexity.' - Geer et al",
3170309588u32);
};
export fn main() i32 = {
vec_empty();
vec_helloworld();
vec_hareiscool();
vec_bdale();
vec_geer();
return 0;
};

View File

@@ -49,12 +49,3 @@ fn check(s: str, ccitt: u16, cmda: u16, dect: u16, ansi: u16) void = {
check("I want peace and I'm willing to fight for it. -- Harry Truman",
0xB0E8u16, 0xFE1Fu16, 0x4659u16, 0x5062u16);
};
export fn main() i32 = {
vec_empty();
vec_truman();
vec_animals();
vec_twain();
vec_peace();
return 0;
};

View File

@@ -52,13 +52,3 @@ fn check(s: str, ieee: u32, cast: u32, koop: u32) void = {
check("GNU's not UNIX",
224734747u32, 200511816u32, 332335539u32);
};
export fn main() i32 = {
vec_empty();
vec_fire();
vec_setfire();
vec_blm();
vec_unix();
vec_gnu();
return 0;
};

View File

@@ -55,14 +55,3 @@ fn check(s: str, ecma: u64, iso: u64) void = {
check("Black lives matter",
0x159BB7B6086BF47Eu64, 0xC218CBB390CF44EBu64);
};
export fn main() i32 = {
vec_empty();
vec_oscar();
vec_hegel();
vec_chapelain();
vec_unix();
vec_gnu();
vec_blm();
return 0;
};

View File

@@ -68,10 +68,3 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
let empty: [1]u8;
assert(!(siphash.sum24(key[0:16], empty[0:0]) != 0x2A51AE0682925836u64));
};
export fn main() i32 = {
refkey_msgN();
ascii();
empty();
return 0;
};

View File

@@ -238,18 +238,3 @@ fn streq(a: str, b: str) bool = {
// can assert WEXITSTATUS == 255 without the test process itself
// terminating. lib/os doesn't ship process spawning yet; revisit
// when that lands.
export fn main() i32 = {
defaultwiredtoglobal();
lprintlnbasic();
lprintlnsingle();
lprintlnempty();
silentwritesnothing();
setloggerswap();
lprintflnbasic();
printflnglobal();
silentignoresprintfln();
lprintflnindexed();
lprintflnmods();
return 0;
};

View File

@@ -383,52 +383,3 @@ import types;
assert(!(types.U64_MIN != 0u64));
assert(!(types.RUNE_MIN != '\0'));
};
export fn main() i32 = {
test_addi8();
test_addi16();
test_addi32();
test_addi64();
test_addu8();
test_addu16();
test_addu32();
test_addu64();
test_subi8();
test_subi16();
test_subi32();
test_subi64();
test_subu8();
test_subu16();
test_subu32();
test_subu64();
test_muli8();
test_muli16();
test_muli32();
test_mulu8();
test_mulu16();
test_mulu32();
test_sat_addi8();
test_sat_addi16();
test_sat_addi32();
test_sat_addi64();
test_sat_addu8();
test_sat_addu16();
test_sat_addu32();
test_sat_addu64();
test_sat_subi8();
test_sat_subi16();
test_sat_subi32();
test_sat_subi64();
test_sat_subu8();
test_sat_subu16();
test_sat_subu32();
test_sat_subu64();
test_sat_muli8();
test_sat_muli16();
test_sat_muli32();
test_sat_mulu8();
test_sat_mulu16();
test_sat_mulu32();
test_types_min();
return 0;
};

View File

@@ -52,12 +52,3 @@ import random;
i += 1;
};
};
export fn main() i32 = {
seq();
deterministic();
u32n_inrange();
u64n_pow2();
u64n_nonpow2();
return 0;
};

View File

@@ -524,17 +524,3 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
let c: (void | io.error) = io.close(s);
match (c) { case void => {}; case let e: io.error => abort(); };
};
export fn main() i32 = {
fixedread();
fixedwritecases();
dynamicgrowcases();
dynamicreset();
borrowedreadcases();
stringview();
dynamicfromseed();
seekcases();
emptyseek();
dynamicseek();
return 0;
};

View File

@@ -106,12 +106,3 @@ fn streq(a: str, b: str) bool = {
assert(!(p[4095] != 165u8));
os.free(p.ptr: *void, 4096u64);
};
export fn main() i32 = {
test_getenv_set();
test_getenv_empty();
test_getenv_unset();
test_getenv_prefix_no_match();
test_alloc_free_roundtrip();
return 0;
};

View File

@@ -204,18 +204,3 @@ fn makebig(n: i32) str = {
let bp = makebig(os.PATH_MAX);
assert(!(os.exists(bp)));
};
export fn main() i32 = {
test_stat_regfile();
test_stat_subdir();
test_stat_noent();
test_stat_symlink_follow();
test_lstat_symlink_nofollow();
test_fstat_regfile();
test_exists_regfile();
test_exists_subdir();
test_exists_noent();
test_stat_toolong();
test_exists_toolong();
return 0;
};

View File

@@ -267,15 +267,3 @@ import path;
assert(!(pop(&buf) as str != "foo"));
assert(!(string(&buf) != "/"));
};
export fn main() i32 = {
push_cases();
isroot_cases();
string_cases();
dirname_basename_cases();
abs_cases();
local_cases();
parent_cases();
popsplit_cases();
return 0;
};

View File

@@ -2568,55 +2568,3 @@ type prrow = struct {
i += 1;
};
};
export fn main() i32 = {
lit_and_match();
size_aliases_distinct();
void_aliases_distinct();
charset_payload();
repeat_payload();
struct_shapes_and_finish();
compile_literal_program();
compile_any_program();
compile_empty_program();
thread_shape();
newmatch_discriminates();
result_free_noop();
strerror_identity();
is_consuming_kinds();
delete_thread_middle();
add_thread_dedup_inherit();
run_thread_literal_program();
run_thread_anchored_route();
search_matches();
search_early_exit();
search_no_match();
test_matches();
find_cases();
findall_content();
findall_fields();
fold3_programs();
fold3_compile_errors();
find_last_groupstart_cases();
shift_direct();
fold3_find_cases();
fold4_programs();
fold4_charsets();
fold4_compile_errors();
fold4_find_cases();
fold4_findall();
add_thread_dup_independence();
fold5_compile_errors();
run_thread_group_arms();
fold5_find_cases();
fold5_optional_group();
fold5_submatches();
parse_repetition_cases();
fold5b_compile_errors();
fold5b_find_cases();
fold5b_findall();
fold6_compile_errors();
fold6_charsets();
fold6_find_cases();
return 0;
};

View File

@@ -178,11 +178,3 @@ fn checkquote(in: str, expected: str) void = {
let s: str = shlex.strerror(e);
assert(!(!streq(s, "Invalid shell syntax")));
};
export fn main() i32 = {
test_split();
test_quote();
test_quotestr();
test_strerror();
return 0;
};

View File

@@ -174,16 +174,3 @@ fn chkf32(n: f32, want: str) bool = {
assert(!(!rt64(math.f64frombits(0x0010000000000000u64)))); // F64_MIN_NORMAL
assert(!(!rt64(math.f64frombits(0x7FEFFFFFFFFFFFFFu64)))); // F64_MAX_NORMAL
};
export fn main() i32 = {
f64tos_fixed();
f64tos_scientific();
f64tos_special();
f32tos_fixed();
f32tos_scientific();
f32tos_extremes();
f32tos_special();
f64_roundtrip();
os.exit(0);
return 0;
};

View File

@@ -296,17 +296,3 @@ fn cks(id: i32, got: str, want: str) void = {
cks(99, i32tos(-2147483648i32, base.DEC), "-2147483648");
cks(100, u8tos(255u8, base.HEX_LOWER), "ff");
};
export fn main() i32 = {
test_stoi64();
test_stoi64_bases();
test_stou64();
test_stou64_bases();
test_stoi_stou_stoz();
test_u64tos_bases();
test_u64tos();
test_i64tos_bases();
test_i64tos();
test_word_wrappers();
return 0;
};

View File

@@ -225,11 +225,3 @@ fn nan32(s: str) bool = {
assert(!(!ovf32("1.0p+128", base.HEX)));
assert(!(!chk32("1.0p-151", base.HEX, 0.0f32)));
};
export fn main() i32 = {
stof64_dec();
stof32_dec();
stof64_hex();
stof32_hex();
return 0;
};

View File

@@ -1671,52 +1671,3 @@ fn expect_str(toks: []str, i: i32, want: str) void = {
assert(!(!streq(a7, "abc")));
assert(!(!streq(b7, "")));
};
export fn main() i32 = {
dup_cases();
dupall_cases();
concat_cases();
join_cases();
hasprefix_cases();
hassuffix_cases();
contains_cases();
byteindex_str_cases();
byteindex_rune_cases();
rbyteindex_cases();
index_cases();
rindex_cases();
trimprefix_cases();
trimsuffix_cases();
ltrim_cases();
rtrim_cases();
trim_cases();
compare_cases();
sub_cases();
bytesub_cases();
utf8_roundtrip_cases();
iter_empty_cases();
iter_ascii_cases();
iter_twobyte_cases();
iter_threebyte_cases();
iter_fourbyte_cases();
iter_mixed_cases();
iter_prev_at_start_cases();
iter_prev_ascii_cases();
iter_full_cases();
iter_position_cases();
iter_iterstr_reverse_cases();
iter_slice_cases();
tokenize_cases();
rtokenize_cases();
peek_token_cases();
remaining_tokens_cases();
splitn_cases();
rsplitn_cases();
split_cases();
lpad_cases();
rpad_cases();
replace_cases();
cut_cases();
rcut_cases();
return 0;
};

View File

@@ -246,11 +246,3 @@ fn strslice(p: str, lo: i32, hi: i32) str = {
assert(!(os.rmdir(d2) != 0));
assert(!(os.rmdir(dsnap) != 0));
};
export fn main() i32 = {
namedroundtrip();
namedoverwrite();
dirlifecycle();
diruniqueness();
return 0;
};

View File

@@ -157,22 +157,3 @@ import time;
assert(!(time.compare(a, b) != -1i8));
assert(!(time.compare(b, a) != 1i8));
};
export fn main() i32 = {
constants();
nowmonotonic();
nowrealtime();
addzero();
addpos_nocarry();
addpos_carry();
addpos_fullsecond();
addneg_noborrow();
addneg_borrow();
diffsimple();
diffneg();
comparelt();
comparegt();
compareeq();
comparensec_only();
return 0;
};

View File

@@ -100,8 +100,3 @@ fn checkname(k: nkind, want: str) void = {
// named value (68); 69 is out of band, exercising the "?" tail.
checkname(69: nkind, "?");
};
export fn main() i32 = {
nkname_cases();
return 0;
};

View File

@@ -307,11 +307,3 @@ fn checkfloat(src: str, want: u64) void = {
checkfloat("1.0e308", 0x7FE1CCF385EBC8A0u64);
checkfloat("2.225073858507202e-308", 0x0010000000000001u64);
};
export fn main() i32 = {
tokname_cases();
kwlookup_cases();
tokprint_cases();
floatfold_cases();
return 0;
};