lib: banner purge + WHY-only comment sweep (rule 8)
Every // ---- section banner dies (132 -> 0): names carry the WHAT. Narration deleted (filename restatements, run-with lines, what-the- next-line-does); every ref/hare cite, task cite, divergence, ABI/ layout contract, and ownership qualifier kept (borrowed-view lines restored where the sweep over-cut). Comment-only proven: all 442 walk-workdir .s and 32 import-probe .s byte-identical before/after; libbyteid 56-roster all-ID.
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
// fnmatchtest — exercises lib/fnmatch. Run with
|
||||
// `out/bin/ww run lib/fnmatch/fnmatchtest.ww`.
|
||||
//
|
||||
// Table-driven via the [[check]] helper: every row is the uniform
|
||||
// 4-tuple `(pattern, string, expected, flags)`. Cases follow Hare's
|
||||
// ref/hare/fnmatch/+test.ha (the de-facto spec for this port);
|
||||
@@ -23,8 +20,6 @@ fn check(pat: str, s: str, expected: bool, flags: i32) void = {
|
||||
assert(!(fnmatch.fnmatch(pat, s, f) != expected));
|
||||
};
|
||||
|
||||
// ---- basic literal / wildcard cases ---------------------------------
|
||||
|
||||
@test fn basic() void = {
|
||||
check("a", "a", true, 0);
|
||||
check("b", "b", true, 0);
|
||||
@@ -59,8 +54,6 @@ fn check(pat: str, s: str, expected: bool, flags: i32) void = {
|
||||
check("*?*?*?*?", "abc", false, 0);
|
||||
};
|
||||
|
||||
// ---- bracket expressions: literal / range / negation ----------------
|
||||
|
||||
@test fn brackets() void = {
|
||||
check("[b]", "b", true, 0);
|
||||
check("a[b]c", "abc", true, 0);
|
||||
@@ -110,8 +103,6 @@ fn check(pat: str, s: str, expected: bool, flags: i32) void = {
|
||||
check("[!-ac]", "b", true, 0);
|
||||
};
|
||||
|
||||
// ---- POSIX character classes: [[:alnum:]] / [[:alpha:]] / ... -------
|
||||
|
||||
@test fn ctype() void = {
|
||||
check("[[:alnum:]]", "7", true, 0);
|
||||
check("[[:alpha:]]", "[", false, 0);
|
||||
@@ -140,8 +131,6 @@ fn check(pat: str, s: str, expected: bool, flags: i32) void = {
|
||||
check("[![:alnum:][:digit:]]", "a", false, 0);
|
||||
};
|
||||
|
||||
// ---- flag.PERIOD: leading '.' must be literal in the pattern --------
|
||||
|
||||
@test fn period() void = {
|
||||
let fp: i32 = 4; // flag.PERIOD
|
||||
check(".", ".", true, fp);
|
||||
@@ -152,16 +141,12 @@ fn check(pat: str, s: str, expected: bool, flags: i32) void = {
|
||||
check(".*", "asdf", false, fp);
|
||||
};
|
||||
|
||||
// ---- flag.NOESCAPE: '\\' loses its escape meaning -------------------
|
||||
|
||||
@test fn noescape() void = {
|
||||
let nesc: i32 = 2; // flag.NOESCAPE
|
||||
check("\\", "\\", true, nesc);
|
||||
check("\\*", "\\asdf", true, nesc);
|
||||
};
|
||||
|
||||
// ---- musl-adapted cases (no flags) ---------------------------------
|
||||
|
||||
@test fn musl_basic() void = {
|
||||
check("*.c", "foo.c", true, 0);
|
||||
check("*.c", ".c", true, 0);
|
||||
@@ -201,8 +186,6 @@ fn check(pat: str, s: str, expected: bool, flags: i32) void = {
|
||||
check("[![:d-d]", "[", false, 0);
|
||||
};
|
||||
|
||||
// ---- flag.PATHNAME: '/' must be matched by literal '/' --------------
|
||||
|
||||
@test fn pathname() void = {
|
||||
let fp: i32 = 1; // flag.PATHNAME
|
||||
check("[a-z]/[a-z]", "a/b", true, fp);
|
||||
@@ -217,8 +200,6 @@ fn check(pat: str, s: str, expected: bool, flags: i32) void = {
|
||||
check("???b", "aa/b", false, fp);
|
||||
};
|
||||
|
||||
// ---- flag.PERIOD + flag.PATHNAME combined ---------------------------
|
||||
|
||||
@test fn combined() void = {
|
||||
let pp: i32 = 1; // PATHNAME
|
||||
let fp: i32 = 4; // PERIOD
|
||||
|
||||
Reference in New Issue
Block a user