mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
16 lines
233 B
Zig
16 lines
233 B
Zig
const Color = enum {
|
|
auto,
|
|
off,
|
|
on,
|
|
};
|
|
|
|
test "exhaustive switching" {
|
|
const color = Color.off;
|
|
switch (color) {
|
|
Color.auto => {},
|
|
Color.on => {},
|
|
}
|
|
}
|
|
|
|
// test_error=unhandled enumeration value
|