diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-08-25 17:28:30 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-08-25 17:28:30 -0400 |
| commit | 2cce171448449fa107aaab1e37a8e8ee8985c6bd (patch) | |
| tree | 2503e925ecda0bfca1a24828d4d59fca3293094e /std | |
| parent | 61c0c6d502b19a6aa232d91a201eba9d67aced5a (diff) | |
| download | zig-2cce171448449fa107aaab1e37a8e8ee8985c6bd.tar.gz zig-2cce171448449fa107aaab1e37a8e8ee8985c6bd.zip | |
add test for previous commit
Diffstat (limited to 'std')
| -rw-r--r-- | std/fmt/index.zig | 9 |
1 files changed, 9 insertions, 0 deletions
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 @@ -940,6 +940,15 @@ test "fmt.format" { 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; const result = try bufPrint(buf1[0..], "f32: {e}\n", value); |
