#![cfg(feature = "sort")] use algors::sort::*; #[test] fn test_bubble() { let mut empty: Vec = Vec::new(); bubble(&mut empty); let mut elems: Vec = vec![2, 3, 1, 4, 6]; bubble(&mut elems); assert_eq!(elems, vec![1, 2, 3, 4, 6]); } #[test] fn test_insertion() { let mut elems: Vec = vec![2, 3, 1, 4, 6]; insertion(&mut elems); assert_eq!(elems, vec![1, 2, 3, 4, 6]); } #[test] fn test_shell() { let mut elems: Vec = vec![2, 3, 1, 4, 6]; shell(&mut elems); assert_eq!(elems, vec![1, 2, 3, 4, 6]); } #[test] fn test_selection() { let mut elems: Vec = vec![2, 3, 1, 4, 6]; selection(&mut elems); assert_eq!(elems, vec![1, 2, 3, 4, 6]); }