#[test]
fn every_console_declaration_in_this_crate_is_in_its_table() {
let declared = crcbl_console::guard::declared_names("src").expect("this crate's src directory");
assert!(
declared.contains(&"log".to_owned()),
"the scan did not reach `log.rs`: {declared:?}",
);
let table = crcbl_core::console_table();
for name in &declared {
assert!(
table
.commands()
.iter()
.any(|command| command.name() == name)
|| table.vars().iter().any(|var| var.name() == name),
"`{name}` is declared in this crate's source and missing from its table",
);
}
}
#[test]
fn the_table_gathers_beside_the_built_ins() {
let registry = crcbl_console::Registry::gather(&[crcbl_core::console_table()])
.expect("no entry of this crate's collides with a built-in");
assert!(
registry.lookup("log").is_some(),
"the command a console would reach",
);
}