algorithmz 1.1.8

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::string::rotate;

#[test]
fn test_rotate_empty() {
    let result = rotate("",10);
    assert_eq!(result, Err("Cannot rotate an empty string!".to_string()));
}

#[test]
fn test_rotate() {
    let result = rotate("dani",2);
    assert_eq!(result, Ok(String::from("nida")));
}