use orphanage::setops::{changes, HashSet}; #[test] fn all() { let old: HashSet = [1, 2].into_iter().collect(); let new: HashSet = [2, 3].into_iter().collect(); let diff = changes(&old, &new); let mut added: Vec = diff.added.into_iter().copied().collect(); added.sort_unstable(); let mut removed: Vec = diff.removed.into_iter().copied().collect(); removed.sort_unstable(); let mut unchanged: Vec = diff.unchanged.into_iter().copied().collect(); unchanged.sort_unstable(); assert_eq!(&added, &[3]); assert_eq!(&removed, &[1]); assert_eq!(&unchanged, &[2]); } // vim: set ft=rust et sw=2 ts=2 sts=2 cinoptions=2 tw=79 :