aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_unhandled_enumeration_value.zig
blob: f25317d6181e00fd961b37826689e79d054ed488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const Color = enum {
    auto,
    off,
    on,
};

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

// test_error=unhandled enumeration value