use libttl::chips::{Chip, Chip7400, PinType};
use libttl::logic_level::nand;
mod chip_tests_common; use chip_tests_common::*;
#[test]
fn test_7400_pin_types() {
let chip = Chip7400::new();
let expected = [
(1, PinType::Input), (2, PinType::Input), (3, PinType::Output),
(4, PinType::Input), (5, PinType::Input), (6, PinType::Output),
(8, PinType::Output), (9, PinType::Input), (10, PinType::Input),
(11, PinType::Output), (12, PinType::Input), (13, PinType::Input),
];
test_pin_types(&chip, &expected);
assert_eq!(chip.pin_count(), 14);
assert_eq!(chip.name(), "7400");
}
#[test]
fn test_7400_logic() {
let mut chip = Chip7400::new();
test_logic_2_input_1_output(&mut chip, 1, 2, 3, nand);
test_logic_2_input_1_output(&mut chip, 4, 5, 6, nand);
test_logic_2_input_1_output(&mut chip, 9, 10, 8, nand);
test_logic_2_input_1_output(&mut chip, 12, 13, 11, nand);
}