use algorithms::nth_element::nth_element;

#[test]
fn test_nth_element() {
    let mut v = [2, 5, 3, 7, 11, 45, 21];
    assert_eq!(nth_element(&mut v, 2).unwrap(), 5);
    assert_eq!(nth_element(&mut v, 5).unwrap(), 21);
    assert_eq!(nth_element(&mut v, 10), None);
}