authorgravatar for kris.tate+github@gmail.comkristopher tate <kris.tate+github@gmail.com> 2018-09-01 19:53:11+09:00
committergravatar for kris.tate+github@gmail.comkristopher tate <kris.tate+github@gmail.com> 2018-09-01 19:53:11+09:00
log7a633f472daba84b03dac18557f411c949f6b875
tree81e882f4e29f54eb81b542324199baa8dd05ce3e
parent454b2362ee5e80dd1236535eaaec70d98e0d33ba

std/fmt/index.zig: #1358: test bytes printed-out as hex;


1 files changed, 6 insertions(+), 0 deletions(-)

std/fmt/index.zig+6
......@@ -1276,6 +1276,12 @@ test "fmt.format" {
12761276
12771277 try testFmt("E.Two", "{}", inst);
12781278 }
1279 //print bytes as hex
1280 {
1281 const some_bytes = "\xCA\xFE\xBA\xBE";
1282 try testFmt("lowercase: cafebabe\n", "lowercase: {x}\n", some_bytes);
1283 try testFmt("uppercase: CAFEBABE\n", "uppercase: {X}\n", some_bytes);
1284 }
12791285}
12801286
12811287fn testFmt(expected: []const u8, comptime template: []const u8, args: ...) !void {