diff --git a/tket2/src/optimiser/badger.rs b/tket2/src/optimiser/badger.rs index 4359166f..75741928 100644 --- a/tket2/src/optimiser/badger.rs +++ b/tket2/src/optimiser/badger.rs @@ -656,6 +656,27 @@ mod tests { opt_rz.hugr_mut().update_validate(®ISTRY).unwrap(); } + #[rstest] + #[case::compiled(badger_opt_compiled())] + #[case::json(badger_opt_json())] + fn rz_rz_cancellation_split_parallel( + rz_rz: Circuit, + #[case] badger_opt: DefaultBadgerOptimiser, + ) { + let mut opt_rz = badger_opt.optimise( + &rz_rz, + BadgerOptions { + timeout: Some(0), + n_threads: 2.try_into().unwrap(), + queue_size: 4, + split_circuit: true, + ..Default::default() + }, + ); + opt_rz.hugr_mut().update_validate(®ISTRY).unwrap(); + assert_eq!(opt_rz.commands().count(), 2); + } + #[rstest] #[ignore = "Loading the ECC set is really slow (~5 seconds)"] fn non_composable_rewrites(