mirror of
https://github.com/ziglang/zig.git
synced 2026-02-19 15:58:50 +00:00
std: use expectError in dynamic_library tests
This commit is contained in:
parent
59e9f529df
commit
7628785983
@ -319,10 +319,7 @@ test "ElfDynLib" {
|
||||
return error.SkipZigTest;
|
||||
}
|
||||
|
||||
_ = ElfDynLib.open("invalid_so.so") catch |err| {
|
||||
try testing.expect(err == error.FileNotFound);
|
||||
return;
|
||||
};
|
||||
try testing.expectError(error.FileNotFound, ElfDynLib.open("invalid_so.so"));
|
||||
}
|
||||
|
||||
pub const WindowsDynLib = struct {
|
||||
@ -423,8 +420,5 @@ test "dynamic_library" {
|
||||
else => return error.SkipZigTest,
|
||||
};
|
||||
|
||||
_ = DynLib.open(libname) catch |err| {
|
||||
try testing.expect(err == error.FileNotFound);
|
||||
return;
|
||||
};
|
||||
try testing.expectError(error.FileNotFound, DynLib.open(libname));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user