chiark / gitweb /
fix new limbval debug
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Nov 2020 00:26:44 +0000 (00:26 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Nov 2020 00:26:44 +0000 (00:26 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
zcoord/zcoord.rs

index 6d63243b7217a9002abda4cb6c58574888233e26..937b6de355518c7450aef7359afe8e7ff835a653 100644 (file)
@@ -142,7 +142,7 @@ impl LimbVal {
 
 impl Debug for LimbVal {
   fn fmt(&self, f: &mut fmt::Formatter) -> Result<(),fmt::Error> {
-    write!(f, "{:x?}", self)
+    write!(f, "lv({:#x?})", self.primitive())
   }
 }
 
@@ -709,6 +709,13 @@ mod test {
     bad("`aaaaaaaa0_#aaaaaaaa0");
   }
 
+  #[test]
+  fn limb_debug() {
+    let l : LimbVal = 0x42.into();
+    assert_eq!( &format!("{:?}", &l),
+                "lv(0x42)" );
+  }
+
   #[test]
   fn inequality() {
     assert!( bf("gg0123abcd_0123456789") <