master
 1const std = @import("std");
 2const expect = std.testing.expect;
 3
 4const Color = enum {
 5    auto,
 6    off,
 7    on,
 8};
 9
10test "enum literals with switch" {
11    const color = Color.off;
12    const result = switch (color) {
13        .auto => false,
14        .on => false,
15        .off => true,
16    };
17    try expect(result);
18}
19
20// test