From 8216b5fc10e7c7b0d4e9f40bb4f9fdaaaebf9400 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 26 Apr 2011 20:49:03 -0400 Subject: Fix the interaction between various flags in #fmt --- src/test/run-pass/syntax-extension-fmt.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/test') 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 "); } -- cgit v1.2.3