mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +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
|