algorithmz 0.8.9

This is the corresponding implemenation of the python module of the same name.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use algorithmz::array::summarize_ranges;

#[test]
fn test_summarize_ranges_empty() {
    let result = summarize_ranges(&[]);
    assert!(matches!(result, Err(ref e) if e == "Cannot summarize ranges of an empty list!"));
}

#[test]
fn test_summarize_ranges() {
    let result = summarize_ranges(&[0, 1, 2, 4, 5, 7]).unwrap();
    assert_eq!(result, vec![(0, 2), (4, 5), (7, 7)]);
}