diff --git a/plate-tool-lib/src/transfer_region.rs b/plate-tool-lib/src/transfer_region.rs index bc312b6..26dbc3f 100644 --- a/plate-tool-lib/src/transfer_region.rs +++ b/plate-tool-lib/src/transfer_region.rs @@ -566,35 +566,33 @@ mod tests { } #[test] - #[wasm_bindgen_test] fn test_pooling_transfer() { + use std::collections::HashSet; let transfer1 = TransferRegion { source_plate: Plate::new(PlateType::Source, PlateFormat::W384), dest_plate: Plate::new(PlateType::Destination, PlateFormat::W384), - source_region: Region::Rect((1, 4), (3, 7)), - dest_region: Region::Point((1, 9)), + source_region: Region::Rect(Well{ row: 1, col: 4}, Well{ row: 3, col: 7}), + dest_region: Region::Point(Well{ row: 1, col: 9}), interleave_source: (1, 1), interleave_dest: (0, 2), }; //let transfer1_source = transfer1.get_source_wells(); - let mut transfer1_dest = transfer1.get_destination_wells(); - transfer1_dest.sort(); - transfer1_dest.dedup(); // Makes our check easier, otherwise we have repeated wells + let transfer1_dest: HashSet = transfer1.get_destination_wells().into_iter().collect(); let transfer1_map = transfer1.calculate_map(); // Skipping source check---it's just 12 wells. assert_eq!( transfer1_dest, - vec![(1, 9), (1, 11), (1, 13), (1, 15)], + vec![Well{ row: 1, col: 9}, Well{ row: 1, col: 11}, Well{ row: 1, col: 13}, Well{ row: 1, col: 15}].into_iter().collect(), "Failed type pool 1 dest" ); assert_eq!( - transfer1_map((2, 6)), - Some(vec![(1, 13)]), + transfer1_map(Well{ row: 2, col: 6}), + Some(vec![Well{ row: 1, col: 13}]), "Failed type pool 1 map 1" ); assert_eq!( - transfer1_map((3, 7)), - Some(vec![(1, 15)]), + transfer1_map(Well{ row: 3, col: 7}), + Some(vec![Well{ row: 1, col: 15}]), "Failed type pool 1 map 2" ); }