mirror of
https://github.com/ziglang/zig.git
synced 2024-12-13 23:00:57 +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
|