diff options
| author | Brian Anderson <andersrb@gmail.com> | 2011-04-26 20:49:03 -0400 |
|---|---|---|
| committer | Brian Anderson <andersrb@gmail.com> | 2011-04-26 20:49:03 -0400 |
| commit | 8216b5fc10e7c7b0d4e9f40bb4f9fdaaaebf9400 (patch) | |
| tree | b7dddff0dda11e1eae672740185f8431952b317b /src/test | |
| parent | 2e12fbfc06abdf1547528047b1438204ca4121a1 (diff) | |
Fix the interaction between various flags in #fmt
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/syntax-extension-fmt.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/test/run-pass/syntax-extension-fmt.rs b/src/test/run-pass/syntax-extension-fmt.rs index 46b529d5847..82b3e658a63 100644 --- a/src/test/run-pass/syntax-extension-fmt.rs +++ b/src/test/run-pass/syntax-extension-fmt.rs @@ -175,6 +175,21 @@ fn main() { test(#fmt("%06.5X", 127u), " 0007F"); test(#fmt("%06.5o", 10u), " 00012"); - // TODO: Padding and + - // TODO: Padding and ' ' + // Signed combinations + test(#fmt("% 5d", 1), " 1"); + test(#fmt("% 5d", -1), " -1"); + test(#fmt("%+5d", 1), " +1"); + test(#fmt("%+5d", -1), " -1"); + test(#fmt("% 05d", 1), " 0001"); + test(#fmt("% 05d", -1), "-0001"); + test(#fmt("%+05d", 1), "+0001"); + test(#fmt("%+05d", -1), "-0001"); + test(#fmt("%- 5d", 1), " 1 "); + test(#fmt("%- 5d", -1), "-1 "); + test(#fmt("%-+5d", 1), "+1 "); + test(#fmt("%-+5d", -1), "-1 "); + test(#fmt("%- 05d", 1), " 1 "); + test(#fmt("%- 05d", -1), "-1 "); + test(#fmt("%-+05d", 1), "+1 "); + test(#fmt("%-+05d", -1), "-1 "); } |
