ifmt - Add a basic test for {:p} getting truncated

This commit is contained in:
John Hodge 2015-02-28 22:51:29 +08:00
parent 4a22c3368f
commit c22d026326

View File

@ -137,6 +137,13 @@ pub fn main() {
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.234e6");
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6");
// Test that pointers don't get truncated.
{
let val = usize::MAX;
let exp = format!("{:#x}", val);
t!(format!("{:p}", val as *const isize), exp);
}
// Escaping
t!(format!("{{"), "{");
t!(format!("}}"), "}");