mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 16:45:27 +00:00
std/fmt/index.zig: #1358: test bytes printed-out as hex;
This commit is contained in:
parent
454b2362ee
commit
7a633f472d
@ -1276,6 +1276,12 @@ test "fmt.format" {
|
||||
|
||||
try testFmt("E.Two", "{}", inst);
|
||||
}
|
||||
//print bytes as hex
|
||||
{
|
||||
const some_bytes = "\xCA\xFE\xBA\xBE";
|
||||
try testFmt("lowercase: cafebabe\n", "lowercase: {x}\n", some_bytes);
|
||||
try testFmt("uppercase: CAFEBABE\n", "uppercase: {X}\n", some_bytes);
|
||||
}
|
||||
}
|
||||
|
||||
fn testFmt(expected: []const u8, comptime template: []const u8, args: ...) !void {
|
||||
|
Loading…
Reference in New Issue
Block a user