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,7 +1,6 @@
|
||||
// stattest — exercises [[os.stat]] / [[os.lstat]] / [[os.fstat]] /
|
||||
// [[os.exists]] against a scratch tree each row arranges itself
|
||||
// under [[temp.dir]] (Hare's own idiom: os tests self-arrange in a
|
||||
// temp dir), so the suite passes bare with no external driver:
|
||||
// Each row arranges its own scratch tree under [[temp.dir]] (Hare's
|
||||
// own idiom: os tests self-arrange in a temp dir), so the suite
|
||||
// passes bare with no external driver:
|
||||
//
|
||||
// <root>/regfile regular file, 11 bytes "hello world", 0644
|
||||
// <root>/symlink → ./regfile (relative symlink)
|
||||
@@ -66,14 +65,6 @@ fn istype(m: os.mode, t: os.mode) bool = {
|
||||
return ((m as u32) & 61440u32) == (t as u32);
|
||||
};
|
||||
|
||||
// ---- stat: regular file --------------------------------------------
|
||||
//
|
||||
// Pinned bytes are "hello world" (11 bytes). We verify:
|
||||
// - mask is fully set (newfstatat fills everything)
|
||||
// - mode's type bits == REG
|
||||
// - sz == 11
|
||||
// - inode is non-zero (real fs entry, not synthetic)
|
||||
|
||||
@test fn test_stat_regfile() void = {
|
||||
let t: tree;
|
||||
mktree(&t);
|
||||
@@ -112,8 +103,6 @@ fn istype(m: os.mode, t: os.mode) bool = {
|
||||
rmtree(&t);
|
||||
};
|
||||
|
||||
// ---- stat: directory ------------------------------------------------
|
||||
|
||||
@test fn test_stat_subdir() void = {
|
||||
let t: tree;
|
||||
mktree(&t);
|
||||
@@ -127,8 +116,6 @@ fn istype(m: os.mode, t: os.mode) bool = {
|
||||
rmtree(&t);
|
||||
};
|
||||
|
||||
// ---- stat: missing path → oserror ENOENT ---------------------------
|
||||
|
||||
@test fn test_stat_noent() void = {
|
||||
let t: tree;
|
||||
mktree(&t);
|
||||
@@ -143,11 +130,6 @@ fn istype(m: os.mode, t: os.mode) bool = {
|
||||
rmtree(&t);
|
||||
};
|
||||
|
||||
// ---- stat (follow) vs lstat (no-follow) on a symlink ----------------
|
||||
//
|
||||
// stat follows the link → reports the regfile (REG, 11 bytes).
|
||||
// lstat does NOT follow → reports the link itself (LINK).
|
||||
|
||||
@test fn test_stat_symlink_follow() void = {
|
||||
let t: tree;
|
||||
mktree(&t);
|
||||
@@ -175,8 +157,6 @@ fn istype(m: os.mode, t: os.mode) bool = {
|
||||
rmtree(&t);
|
||||
};
|
||||
|
||||
// ---- fstat: open a file and stat by fd ------------------------------
|
||||
|
||||
@test fn test_fstat_regfile() void = {
|
||||
let t: tree;
|
||||
mktree(&t);
|
||||
@@ -194,8 +174,6 @@ fn istype(m: os.mode, t: os.mode) bool = {
|
||||
rmtree(&t);
|
||||
};
|
||||
|
||||
// ---- exists: true on regfile/dir/symlink, false on noent ------------
|
||||
|
||||
@test fn test_exists_regfile() void = {
|
||||
let t: tree;
|
||||
mktree(&t);
|
||||
@@ -217,8 +195,6 @@ fn istype(m: os.mode, t: os.mode) bool = {
|
||||
rmtree(&t);
|
||||
};
|
||||
|
||||
// ---- ENAMETOOLONG: kpath rejects paths >= PATH_MAX -------------------
|
||||
//
|
||||
// kpath copies into a single [PATH_MAX]u8 buffer and reserves one byte
|
||||
// for the NUL terminator (`p.len + 1 >= PATH_MAX` → reject). The
|
||||
// rejection surfaces as `oserror = -36` (ENAMETOOLONG) on (... |
|
||||
|
||||
Reference in New Issue
Block a user