diff --git a/std/fmt/index.zig b/std/fmt/index.zig index a3d2344740..82e9a5ba39 100644 --- a/std/fmt/index.zig +++ b/std/fmt/index.zig @@ -939,6 +939,15 @@ test "fmt.format" { try testFmt("struct: Struct{ .field = 42 }\n", "struct: {}\n", value); try testFmt("struct: Struct{ .field = 42 }\n", "struct: {}\n", &value); } + { + const Enum = enum { + One, + Two, + }; + const value = Enum.Two; + try testFmt("enum: Enum.Two\n", "enum: {}\n", value); + try testFmt("enum: Enum.Two\n", "enum: {}\n", &value); + } { var buf1: [32]u8 = undefined; const value: f32 = 1.34;