From: Ian Jackson Date: Sat, 21 Nov 2020 00:26:44 +0000 (+0000) Subject: fix new limbval debug X-Git-Tag: otter-0.2.0~450 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=aece14bf8f33658ee013dc6d81467a3040f1076f;p=otter.git fix new limbval debug Signed-off-by: Ian Jackson --- diff --git a/zcoord/zcoord.rs b/zcoord/zcoord.rs index 6d63243b..937b6de3 100644 --- a/zcoord/zcoord.rs +++ b/zcoord/zcoord.rs @@ -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") <