use cordis::PluginRegistry;
#[test]
fn inventory_registry_matches_expected_factory_set() {
let force = PluginRegistry::new();
#[cfg(feature = "postgres")]
ares_store::register_plugins(&force);
ares_tools::register_plugins(&force);
ares_llm::register_plugins(&force);
ares_agent::register_plugins(&force);
ares_http::register_plugins(&force);
drop(force);
let reg = PluginRegistry::new();
cordis::register_inventory_factories(®);
let mut names = reg.names();
names.sort();
#[cfg(feature = "postgres")]
let mut expected: Vec<String> = vec![
"EventsService".to_string(),
"Store".to_string(),
"Execute".to_string(),
"SchedulerService".to_string(),
"PipelineService".to_string(),
"TriggerService".to_string(),
"CalculatorService".to_string(),
"Tools".to_string(),
"Llm".to_string(),
"RhaiPolicy".to_string(),
];
#[cfg(not(feature = "postgres"))]
let mut expected: Vec<String> = vec![
"EventsService".to_string(),
"CalculatorService".to_string(),
"Tools".to_string(),
"Llm".to_string(),
"Execute".to_string(),
];
expected.push("Http".to_string());
#[cfg(feature = "postgres")]
expected.push("AuthService".to_string());
expected.sort();
assert_eq!(
names, expected,
"inventory-collected factories diverge from the manual registration set"
);
}
#[test]
fn inventory_registry_is_nonempty() {
let force = PluginRegistry::new();
ares_tools::register_plugins(&force);
drop(force);
let reg = PluginRegistry::new();
cordis::register_inventory_factories(®);
assert!(
!reg.names().is_empty(),
"inventory collected no factories; linker sections may be dropped"
);
}