mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
add tests for fixed stage1 bugs
Closes #10357 Closes #11236 Closes #11615 Closes #12055
This commit is contained in:
@@ -930,6 +930,16 @@ test "optional error set return type" {
|
||||
try expect(E.A == S.foo(false).?);
|
||||
}
|
||||
|
||||
test "optional error set function parameter" {
|
||||
const S = struct {
|
||||
fn doTheTest(a: ?anyerror) !void {
|
||||
try std.testing.expect(a.? == error.OutOfMemory);
|
||||
}
|
||||
};
|
||||
try S.doTheTest(error.OutOfMemory);
|
||||
try comptime S.doTheTest(error.OutOfMemory);
|
||||
}
|
||||
|
||||
test "returning an error union containing a type with no runtime bits" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
|
||||
Reference in New Issue
Block a user