diff options
| author | Brian Anderson <[email protected]> | 2011-04-18 22:24:27 -0400 |
|---|---|---|
| committer | Brian Anderson <[email protected]> | 2011-04-18 22:53:26 -0400 |
| commit | 7f90000ab6d823300c73a232715bb965935c932d (patch) | |
| tree | ced515ef18ad488f13a61f2b10c5c5272c2edf4f /src/test | |
| parent | Rearrange ExtFmt.RT.pad to recover some horizontal space (diff) | |
| download | rust-7f90000ab6d823300c73a232715bb965935c932d.tar.xz rust-7f90000ab6d823300c73a232715bb965935c932d.zip | |
Precision overrides 0-padding in #fmt
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/syntax-extension-fmt.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/test/run-pass/syntax-extension-fmt.rs b/src/test/run-pass/syntax-extension-fmt.rs index c3b2cd76..c5ad77f8 100644 --- a/src/test/run-pass/syntax-extension-fmt.rs +++ b/src/test/run-pass/syntax-extension-fmt.rs @@ -150,7 +150,17 @@ fn main() { test(#fmt("%-05s", "test"), "test "); test(#fmt("%-05b", true), "true "); - // TODO: Precision overrides 0-padding + // Precision overrides 0-padding + test(#fmt("%06.5d", 0), " 00000"); + test(#fmt("%06.5u", 0u), " 00000"); + test(#fmt("%06.5x", 0u), " 00000"); + test(#fmt("%06.5d", 10), " 00010"); + test(#fmt("%06.5d", -10), "-00010"); + test(#fmt("%06.5u", 10u), " 00010"); + test(#fmt("%06.5s", "test"), " test"); + test(#fmt("%06.5x", 127u), " 0007f"); + test(#fmt("%06.5X", 127u), " 0007F"); + // TODO: Padding and + // TODO: Padding and ' ' } |