v0.2.1-pre.006-fix.001

This commit is contained in:
2026-08-17 21:16:26 +02:00
parent f5d98c4e69
commit 598474438b
6 changed files with 162 additions and 11 deletions

View File

@@ -1,20 +1,26 @@
// file: crates/ksp-app-config-desk/unit_tests/profiles.rs
// version: 2
// version: 3
#[test]
fn profile_inventory_exposes_logging_default_and_available_profiles() {
fn profile_inventory_exposes_registered_standard_profile_documents() {
let management = fixture_management();
assert!(management.is_ok(), "fixture management should construct: {management:?}");
if let std::result::Result::Ok(management) = management {
let inventory = super::inventory_from_management(&management);
assert!(inventory.is_ok(), "profile inventory should resolve: {inventory:?}");
if let std::result::Result::Ok(inventory) = inventory {
assert_eq!(inventory.len(), 1);
assert_eq!(inventory[0].file_id, ksp_config_lib::FILE_ID_STD_LOGGING);
assert!(!inventory[0].default_profile.is_empty());
assert!(inventory[0].profile_ids.iter().any(|profile_id| {
return profile_id == &inventory[0].default_profile;
assert!(inventory.iter().any(|document| -> bool {
return document.file_id == ksp_config_lib::FILE_ID_STD_LOGGING;
}));
assert!(inventory.iter().any(|document| -> bool {
return document.file_id == ksp_config_lib::FILE_ID_STD_TRANSPORT;
}));
for document in inventory {
assert!(!document.default_profile.is_empty());
assert!(document.profile_ids.iter().any(|profile_id| -> bool {
return profile_id == &document.default_profile;
}));
}
}
}
}