pipecircuit-cli 0.0.4

Command-line architectural tools for Pipecircuit programs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use pipecircuit::StateMachine;

use super::{Activate, Latch};
use crate::domain_primitives::Activation;

#[test]
fn a_new_latch_activates() {
    assert_eq!(Latch::default().step(Activate), Activation::Activated);
}

#[test]
fn repeated_activation_preserves_the_active_state() {
    let mut latch = Latch::default();
    assert_eq!(latch.step(Activate), Activation::Activated);
    for _ in 0..3 {
        assert_eq!(latch.step(Activate), Activation::AlreadyActive);
    }
}