ww: enforce internal package visibility
This commit is contained in:
@@ -157,6 +157,25 @@ fn istype(m: os.mode, t: os.mode) bool = {
|
||||
rmtree(&t);
|
||||
};
|
||||
|
||||
@test fn test_readlink_verbatim() void = {
|
||||
let t: tree;
|
||||
mktree(&t);
|
||||
let buf: [16]u8;
|
||||
let i: i32 = 0;
|
||||
for (i < 16) { buf[i] = 90u8; i += 1; }; // 'Z'
|
||||
let n: i64 = os.readlink(t.symlink, &buf[0], 16u64);
|
||||
assert(!(n != 9i64));
|
||||
let want: str = "./regfile";
|
||||
i = 0;
|
||||
for (i < want.len) {
|
||||
assert(!(buf[i] != want[i]));
|
||||
i += 1;
|
||||
};
|
||||
let ni: i32 = n: i32;
|
||||
assert(!(buf[ni] != 90u8));
|
||||
rmtree(&t);
|
||||
};
|
||||
|
||||
@test fn test_fstat_regfile() void = {
|
||||
let t: tree;
|
||||
mktree(&t);
|
||||
@@ -196,7 +215,7 @@ fn istype(m: os.mode, t: os.mode) bool = {
|
||||
};
|
||||
|
||||
// kpath copies into a single [PATH_MAX]u8 buffer and reserves one byte
|
||||
// for the NUL terminator (`p.len + 1 >= PATH_MAX` → reject). The
|
||||
// for the NUL terminator (`p.len + 1 > PATH_MAX` → reject). The
|
||||
// rejection surfaces as `oserror = -36` (ENAMETOOLONG) on (... |
|
||||
// oserror)-returning wrappers, and as `false` on [[os.exists]]
|
||||
// (Hare's os::exists doc: "true if a node exists at the given path,
|
||||
|
||||
Reference in New Issue
Block a user