diff --git a/gen/src/arbitrary_impls.rs b/gen/src/arbitrary_impls.rs index ae544b1..55f1bd5 100644 --- a/gen/src/arbitrary_impls.rs +++ b/gen/src/arbitrary_impls.rs @@ -23,7 +23,7 @@ impl Arbitrary for LowerAToZNumDash { let i = v % 37; match i { - 0 => '-' as u8, + 0 => b'-', 1..=10 => i + 47, _ => i + 86, } diff --git a/gen/src/lib.rs b/gen/src/lib.rs index 3426c86..884a195 100644 --- a/gen/src/lib.rs +++ b/gen/src/lib.rs @@ -683,8 +683,6 @@ pub fn gen_rnd_demo_data(size: u8) -> Vec { loop { let mut tce = Tce::arbitrary(&mut og); - tce.shipment_id = ship_foot.shipment_id.clone(); - if let Some(prev_tce) = tces.last() { // Updates prevTceIds for the current TCE prev_tces.push(prev_tce.tce_id.clone()); @@ -725,6 +723,8 @@ pub fn gen_rnd_demo_data(size: u8) -> Vec { Some(vec![CharFactors::Ar6]), ); + tce.shipment_id.clone_from(&ship_foot.shipment_id); + hocs.push(hoc); } @@ -753,9 +753,12 @@ pub fn gen_rnd_demo_data(size: u8) -> Vec { Some(vec![CharFactors::Ar6]), ); + tce.shipment_id.clone_from(&ship_foot.shipment_id); + tocs.push(toc.clone()); } + tces.push(tce); i += 1; if i == limit { diff --git a/gen/src/pact_integration.rs b/gen/src/pact_integration.rs index 5bdf0f8..08a864a 100644 --- a/gen/src/pact_integration.rs +++ b/gen/src/pact_integration.rs @@ -354,8 +354,8 @@ fn ship_foot_to_pfc() { "ShipmentFootprint with id shipment-test" ); assert_eq!(pfc.pcf.declared_unit, DeclaredUnit::TonKilometer); - assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(33840).into()); - assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(3131.06).into()); + assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(33840)); + assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(3131.06)); } #[test] @@ -401,8 +401,8 @@ fn toc_to_pcf() { assert_eq!(pfc.product_name_company.0, "TOC with ID toc-test"); assert_eq!(pfc.pcf.declared_unit, DeclaredUnit::TonKilometer); - assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(1).into()); - assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(0.007).into()); + assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(1)); + assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(0.007)); } #[test] @@ -452,6 +452,6 @@ fn hoc_to_pfc() { assert_eq!(pfc.product_name_company.0, "HOC with ID hoc-test"); assert_eq!(pfc.pcf.declared_unit, DeclaredUnit::Kilogram); - assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(1000).into()); - assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(33).into()); + assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(1000)); + assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(33)); }