Skip to content

Commit 5337f31

Browse files
committed
test: Fix fallout in formatter tests
1 parent 2ff6ea5 commit 5337f31

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/test/run-pass/ifmt.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ impl fmt::Display for C {
4242
macro_rules! t {
4343
($a:expr, $b:expr) => { assert_eq!($a, $b) }
4444
}
45+
#[cfg(target_pointer_width = "32")]
46+
const PTR: &'static str = "0x00001234";
47+
#[cfg(target_pointer_width = "64")]
48+
const PTR: &'static str = "0x0000000000001234";
4549

4650
pub fn main() {
4751
// Various edge cases without formats
@@ -72,8 +76,8 @@ pub fn main() {
7276
t!(format!("{:X}", 10_usize), "A");
7377
t!(format!("{}", "foo"), "foo");
7478
t!(format!("{}", "foo".to_string()), "foo");
75-
t!(format!("{:p}", 0x1234 as *const isize), "0x1234");
76-
t!(format!("{:p}", 0x1234 as *mut isize), "0x1234");
79+
t!(format!("{:p}", 0x1234 as *const isize), PTR);
80+
t!(format!("{:p}", 0x1234 as *mut isize), PTR);
7781
t!(format!("{:x}", A), "aloha");
7882
t!(format!("{:X}", B), "adios");
7983
t!(format!("foo {} ☃☃☃☃☃☃", "bar"), "foo bar ☃☃☃☃☃☃");

0 commit comments

Comments
 (0)