#[ cfg( feature = "enabled" ) ]
mod enabled
{
use unilang::registry::CommandRegistry;
#[ test ]
fn tc500_commands_yaml_is_valid_path()
{
let path = claude_profile::COMMANDS_YAML;
assert!( !path.is_empty(), "COMMANDS_YAML must not be empty" );
assert!(
std::path::Path::new( path ).extension().is_some_and( | ext | ext.eq_ignore_ascii_case( "yaml" ) ),
"COMMANDS_YAML must end with .yaml: {path}"
);
}
#[ test ]
fn tc501_register_commands_callable()
{
let mut registry = CommandRegistry::new();
claude_profile::register_commands( &mut registry );
assert!( registry.command( ".account.list" ).is_some(), ".account.list must be registered" );
assert!( registry.command( ".usage" ).is_some(), ".usage must be registered" );
assert!( registry.command( ".paths" ).is_some(), ".paths must be registered" );
}
#[ test ]
fn tc502_all_shared_commands_registered()
{
let mut registry = CommandRegistry::new();
claude_profile::register_commands( &mut registry );
let expected = [
".account.list",
".account.limits",
".account.status",
".account.save",
".account.switch",
".account.delete",
".token.status",
".paths",
".usage",
];
for name in &expected
{
assert!(
registry.command( name ).is_some(),
"command {name} must be registered"
);
}
}
}