aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-04-26 20:49:03 -0400
committerBrian Anderson <[email protected]>2011-04-26 20:49:03 -0400
commit8216b5fc10e7c7b0d4e9f40bb4f9fdaaaebf9400 (patch)
treeb7dddff0dda11e1eae672740185f8431952b317b /src/test
parentSupport octal #fmt conversions (diff)
downloadrust-8216b5fc10e7c7b0d4e9f40bb4f9fdaaaebf9400.tar.xz
rust-8216b5fc10e7c7b0d4e9f40bb4f9fdaaaebf9400.zip
Fix the interaction between various flags in #fmt
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/syntax-extension-fmt.rs19
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 46b529d5..82b3e658 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 ");
}