diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/syntax-extension-fmt.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/run-pass/syntax-extension-fmt.rs b/src/test/run-pass/syntax-extension-fmt.rs index 935c87c1..5c66b17a 100644 --- a/src/test/run-pass/syntax-extension-fmt.rs +++ b/src/test/run-pass/syntax-extension-fmt.rs @@ -104,4 +104,12 @@ fn main() { test(#fmt("%.5x", 127u), "0007f"); test(#fmt("%.5t", 3u), "00011"); test(#fmt("%.5c", 'A'), "A"); + + // Bool precision. I'm not sure if it's good or bad to have bool + // conversions support precision - it's not standard printf so we + // can do whatever. For now I'm making it behave the same as string + // conversions. + test(#fmt("%.b", true), ""); + test(#fmt("%.0b", true), ""); + test(#fmt("%.1b", true), "t"); } |