]> git.lizzy.rs Git - rust.git/commitdiff
coretest: Ensure that pointer formatting flags are cleaned up
authorPiotr Czarnecki <pioczarn@gmail.com>
Mon, 25 Aug 2014 13:31:42 +0000 (14:31 +0100)
committerPiotr Czarnecki <pioczarn@gmail.com>
Tue, 9 Sep 2014 19:34:41 +0000 (20:34 +0100)
src/libcoretest/fmt/mod.rs

index 9fc09b3124ef381864c131bbe8710639faa65ed4..3f2208e6c2dadedaac61638a8912838f95f01caf 100644 (file)
@@ -9,3 +9,10 @@
 // except according to those terms.
 
 mod num;
+
+#[test]
+fn test_format_flags() {
+    // No residual flags left by pointer formatting
+    let p = "".as_ptr();
+    assert_eq!(format!("{:p} {:x}", p, 16u), format!("{:p} 10", p));
+}