lib: expectabort rows for the restored preconditions; retire 989_libprecond_abort.c
The three must-abort runs (u32n/u64n zero, decodedsize unaligned) move into the owning lib suites as test.expectabort rows; the five normal-return controls already live in the r989_libprecond_* fixtures. wwstage parity rides the lib-wide cs==ww byte identity gate.
This commit is contained in:
@@ -16,6 +16,7 @@ import errors;
|
||||
import io;
|
||||
import memio;
|
||||
import strings;
|
||||
import test;
|
||||
|
||||
|
||||
fn streq(a: str, b: str) bool = {
|
||||
@@ -162,6 +163,15 @@ fn inval_check(enc: *base64.encoding, encoded: str) void = {
|
||||
assert(!(base64.decodedsize(164) != 123));
|
||||
};
|
||||
|
||||
// A non-multiple-of-4 input is out of domain and must abort loudly,
|
||||
// never return garbage. Pins the restored Hare precondition
|
||||
// (ref/hare/encoding/base64/base64.ha:597, assert(sz % 4 == 0)).
|
||||
|
||||
@test fn decodedsize_unaligned_aborts() void = {
|
||||
test.expectabort();
|
||||
base64.decodedsize(5i32);
|
||||
};
|
||||
|
||||
// ---- round-trip every byte value 0..255 (std + url) ----
|
||||
|
||||
@test fn roundtrip_all_bytes() void = {
|
||||
|
||||
Reference in New Issue
Block a user