aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
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 ");
}