Error if executed as root (e.g. container):
1/1 test_zwhich.test.filesystem helpers...FAIL (TestUnexpectedResult)
/root/.local/share/zvm/0.16.0/lib/std/testing.zig:615:14: 0x122c7b9 in expect (std.zig)
if (!ok) return error.TestUnexpectedResult;
^
/workspace/ch02/test_zwhich.zig:122:9: 0x122d3a8 in test.filesystem helpers (test_zwhich.zig)
try testing.expect(!isExecutable(io, abs_file_path));
^
0 passed; 0 skipped; 1 failed.
error: the following test command failed with exit code 1:
/root/.cache/zig/o/4773a1496fa929c7d6150e316983a0a9/test --seed=0x2ec3d04a
Test that fails:
// Case B: Make it non-executable (644)
_ = std.c.fchmod(file.handle, 0o644);
try testing.expect(!isExecutable(io, abs_file_path));
Error if executed as root (e.g. container):
Test that fails: