diff options
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | src/vm/de.rs | 19 |
2 files changed, 11 insertions, 12 deletions
diff --git a/Cargo.toml b/Cargo.toml index 3b205c1..e16edb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,13 +15,13 @@ homepage = "https://soniex2.github.io/ganarchy/project/c0b4a8a326a320ac33c5d9d6b erased-serde = "0.3.21" impl_trait = "0.1.7" indexmap = "1.9.1" -postcard = "1.0.2" regex = "1" serde = "1.0.140" -serde_transmute = "0.1.4" +# serde_transmute = "0.1.4" smallvec = "1.10.0" [dev-dependencies] +postcard = "1.0.2" proptest = "1.0.0" serde_json = "1.0.82" serde = {version = "1.0.140", features = ["derive"]} 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)); } } |