std/fmt.zig: Pass full options struct to all internal functions

The fill specifier is now handled in some cases. The default fill of '0'
is now ' ' for integers and non-byte sequences.
This commit is contained in:
Marc Tiehuis
2019-08-18 11:17:16 +12:00
parent 6844dafeca
commit 98859c885e
3 changed files with 62 additions and 55 deletions

View File

@@ -124,7 +124,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
\\ const stdout = &(io.getStdOut() catch unreachable).outStream().stream;
\\ stdout.print("Hello, world!\n{d:4} {x:3} {c}\n", u32(12), u16(0x12), u8('a')) catch unreachable;
\\}
, "Hello, world!\n0012 012 a\n");
, "Hello, world!\n 12 12 a\n");
cases.addC("number literals",
\\const builtin = @import("builtin");