mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32: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
|