parse-numeric-range 0.1.0

Parse a string of numbers and ranges (e.g. 1,3-5,8) into a list of integers. A faithful port of the parse-numeric-range npm package. Zero dependencies, no_std.
Documentation
//! Integration tests exercising the public API of `parse-numeric-range`.

use parse_numeric_range::parse;

#[test]
fn line_selection_use_case() {
    // Typical syntax-highlighter usage: highlight lines 1, 5, 7, 8, 9.
    assert_eq!(parse("1, 5, 7-9"), [1, 5, 7, 8, 9]);
}

#[test]
fn mixed_and_messy() {
    assert_eq!(parse(" 10-8 , 1 , 3-3 "), [10, 9, 8, 1, 3]);
    assert_eq!(parse("a,1,b-c,2"), [1, 2]);
    assert_eq!(parse(",,,"), [] as [i64; 0]);
}

#[test]
fn exclusive_unicode() {
    assert_eq!(parse("1\u{2026}4"), [1, 2, 3]);
    assert_eq!(parse("4\u{2025}1"), [4, 3, 2, 1]);
}

#[test]
fn large_range_does_not_panic() {
    let v = parse("1-1000");
    assert_eq!(v.len(), 1000);
    assert_eq!((v[0], v[999]), (1, 1000));
}