about summary refs log tree commit diff
path: root/lang/zig/switch-exhaust.zig
blob: 4777f19cfd873e2abdc3a7ec071ed8435fe2b807 (plain) (blame)
1
2
3
4
5
6
7
8
9
const Color = enum { auto, off, on };

test "exhaustive switching" {
    const color = Color.off;
    switch (color) {
        Color.auto => {},
        Color.on => {},
    }
}