mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +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.
|
// MacOS maximum pid appears to be 99999 and not configurable.
|
||||||
// Others are unknown thus not tested.
|
// Others are unknown thus not tested.
|
||||||
const impossible_pid: posix.pid_t = 1_999_999_999;
|
const impossible_pid: posix.pid_t = 1_999_999_999;
|
||||||
posix.kill(impossible_pid, .INVAL) catch |err| switch (err) {
|
try std.testing.expectError(posix.KillError.ProcessNotFound, posix.kill(impossible_pid, .INVAL));
|
||||||
posix.KillError.ProcessNotFound => return,
|
|
||||||
else => return err,
|
|
||||||
};
|
|
||||||
return error.ProcessShouldHaveNotBeenFound;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_kill_zero_self_should_succeed() !void {
|
fn test_kill_zero_self_should_succeed() !void {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue