logic-gates 0.1.0

Logic Gates
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::bytes::FourBit;
use crate::Signal;

#[test]
fn fourbit_parse() -> Result<(), Box<dyn std::error::Error>> {
    let bit1 = FourBit {
        bit1: Signal::One,
        bit2: Signal::Zero,
        bit3: Signal::Zero,
        bit4: Signal::One,
    };

    let bit2: FourBit = "1001".parse()?;
    assert_eq!(bit1, bit2);

    Ok(())
}