Skip to content

ch02/test_zwitch.zig fails a test #1

Description

@cento

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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions