ifmt - Add a basic test for {:p} getting truncated
This commit is contained in:
parent
4a22c3368f
commit
c22d026326
@ -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!("}}"), "}");
|
||||
|
Loading…
Reference in New Issue
Block a user