test_unhandled_enumeration_value.zig (233B) - Raw
1 const Color = enum { 2 auto, 3 off, 4 on, 5 }; 6 7 test "exhaustive switching" { 8 const color = Color.off; 9 switch (color) { 10 Color.auto => {}, 11 Color.on => {}, 12 } 13 } 14 15 // test_error=unhandled enumeration value