mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 09:25:11 +00:00
And fix test cases to make them pass. This is in preparation for starting to pass behavior tests with self-hosted.
12 lines
279 B
Zig
12 lines
279 B
Zig
const std = @import("std");
|
|
|
|
const Union = union(enum) {
|
|
Text: []const u8,
|
|
Color: u32,
|
|
};
|
|
|
|
test "const error union field alignment" {
|
|
var union_or_err: anyerror!Union = Union{ .Color = 1234 };
|
|
std.testing.expect((union_or_err catch unreachable).Color == 1234);
|
|
}
|