add tests for fixed stage1 bugs

Closes #10357
Closes #11236
Closes #11615
Closes #12055
This commit is contained in:
Veikka Tuominen
2024-03-28 12:58:55 +02:00
parent 0588595128
commit 60614b2a85
5 changed files with 56 additions and 21 deletions
+10
View File
@@ -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