From 6fac8900d19b9406229e5bf2b36fbfbbdfe548d4 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 30 Oct 2022 21:27:29 -0300 Subject: Clean up --- src/vm/de.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/vm/de.rs') diff --git a/src/vm/de.rs b/src/vm/de.rs index dc3e9b3..471b541 100644 --- a/src/vm/de.rs +++ b/src/vm/de.rs @@ -196,7 +196,6 @@ impl<'pat, 'state, 'de, O: Serialize> Packer<'pat, 'state, O> { // iterate backwards let index = orig_len - index - 1; let frame = &mut self.interp.frames[index]; - dbg!(index); let has_pack = frame.matches; if frame.overstep > 0 { // handle overstep @@ -843,10 +842,8 @@ where } } let obj = SerdeObject::Map(obj_inner); - dbg!(&self.interp.frames); let mut final_packs = self.step_out(output_packs); let mut iter_final_packs = 0..; - dbg!(&self.interp.frames); self.frames_mut().iter_active_mut().for_each(|frame| { let ty = frame.get_type(); match ty { @@ -1245,7 +1242,7 @@ mod tests { MAX_CALLS, ).deserialize(&mut der).unwrap(); assert!(obj.is_none()); - assert!(packs.len() == 1); + assert_eq!(packs.len(), 1); let pack = packs.pop().unwrap(); assert!(pack.subpacks.is_empty()); } @@ -1284,9 +1281,9 @@ mod tests { ).deserialize(&mut der); let (mut packs, obj) = result.unwrap(); assert!(obj.is_none()); - assert!(packs.len() == 1); + assert_eq!(packs.len(), 1); let pack = packs.pop().unwrap(); - assert!(pack.subpacks.len() == 2); + assert_eq!(pack.subpacks.len(), 2); } #[test] @@ -1323,9 +1320,9 @@ mod tests { ).deserialize(&mut der); let (mut packs, obj) = result.unwrap(); assert!(obj.is_none()); - assert!(packs.len() == 1); + assert_eq!(packs.len(), 1); let pack = packs.pop().unwrap(); - assert!(pack.subpacks.len() == 2); + assert_eq!(pack.subpacks.len(), 2); } #[test] @@ -1362,9 +1359,11 @@ mod tests { ).deserialize(&mut der); let (mut packs, obj) = result.unwrap(); assert!(obj.is_none()); - assert!(packs.len() == 1); + assert_eq!(packs.len(), 1); let pack = packs.pop().unwrap(); - assert!(pack.subpacks.len() == 2); + assert_eq!(pack.subpacks.len(), 2); + assert_eq!(pack.subpacks[0]["name"].1, SerdeObject::Str(From::from("a"))); + assert_eq!(pack.subpacks[1]["value"].1, SerdeObject::U32(1)); } } -- cgit 1.4.1