rs_state_machine 2.0.0

A business-oriented state machine library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{define, core::machine::Machine};

#[test]
fn should_parse_one_line() {
    let machine = define!("A" -"B"->"C");
    assert_eq!(1, machine.transitions.len(), "Machine should have exactly 1 transition");
}

#[test]
fn should_parse_multiple_lines() {
    let machine = define!(
        "A" -"B"->"C",
        "D" -"E"->"F",
        "G" -"H"->"I"
    );
    assert_eq!(3, machine.transitions.len(), "Machine should have exactly 3 transitions")
}