mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
use testing.expectError
This commit is contained in:
parent
cdb85b2c87
commit
a79ccf9679
1 changed files with 1 additions and 5 deletions
|
|
@ -14,11 +14,7 @@ fn test_kill_nonexistent() !void {
|
|||
// MacOS maximum pid appears to be 99999 and not configurable.
|
||||
// Others are unknown thus not tested.
|
||||
const impossible_pid: posix.pid_t = 1_999_999_999;
|
||||
posix.kill(impossible_pid, .INVAL) catch |err| switch (err) {
|
||||
posix.KillError.ProcessNotFound => return,
|
||||
else => return err,
|
||||
};
|
||||
return error.ProcessShouldHaveNotBeenFound;
|
||||
try std.testing.expectError(posix.KillError.ProcessNotFound, posix.kill(impossible_pid, .INVAL));
|
||||
}
|
||||
|
||||
fn test_kill_zero_self_should_succeed() !void {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue