algorithmz 1.2.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
14
15
16
17
use algorithmz::string::z_algorithm;

#[test]
fn test_z_algorithm() {
    let text = "aaaaa";
    let pattern = "aa";
    let result = z_algorithm(text, pattern);
    assert_eq!(result, vec![0,1,2,3]);
}

#[test]
fn test_z_algorithm_zero_match() {
    let text = "abcdefg";
    let pattern = "xyz";
    let result = z_algorithm(text, pattern);
    assert_eq!(result, vec![]);
}