v0.1.4-pre.015-fix.002
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-config-lib/unit_tests/document.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
#[test]
|
||||
fn committed_logging_document_passes_registered_schema_and_semantic_validation() {
|
||||
@@ -17,10 +17,16 @@ fn committed_logging_document_passes_registered_schema_and_semantic_validation()
|
||||
if let std::result::Result::Ok(document) = document {
|
||||
assert_eq!(document.file_id(), &file_id);
|
||||
assert_eq!(document.path(), workspace.join("config/std.logging.json").as_path());
|
||||
let default_profile = document.value().get("default_profile");
|
||||
let default_profile = document.value().get("default_profile").and_then(serde_json::Value::as_str);
|
||||
assert!(default_profile.is_some(), "validated Logging document should retain default_profile");
|
||||
if let std::option::Option::Some(default_profile) = default_profile {
|
||||
assert_eq!(default_profile.as_str(), std::option::Option::Some("local_dev"));
|
||||
let profiles = document.value().get("profiles").and_then(serde_json::Value::as_array);
|
||||
assert!(profiles.is_some(), "validated Logging document should retain profiles");
|
||||
if let std::option::Option::Some(profiles) = profiles {
|
||||
assert!(profiles.iter().any(|profile| -> bool {
|
||||
return profile.get("profile_id").and_then(serde_json::Value::as_str) == std::option::Option::Some(default_profile);
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user