std: use expectError in dynamic_library tests
This commit is contained in:
committed by
Veikka Tuominen
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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user