Files
khadhroony-solana-project/crates/ksp-app-config-desk/unit_tests/logging_runtime.rs
2026-08-16 19:00:49 +02:00

27 lines
1012 B
Rust

// file: crates/ksp-app-config-desk/unit_tests/logging_runtime.rs
// version: 1
#[test]
fn launch_identity_is_safe_and_contains_application_and_process_identity() {
let identity = super::launch_identity();
assert!(identity.is_ok());
if let std::result::Result::Ok(identity) = identity {
assert_eq!(identity.application_id(), crate::TRACING_TARGET);
assert!(identity.launch_timestamp().contains("Z-p"));
assert!(identity.launch_timestamp().ends_with(std::process::id().to_string().as_str()));
}
}
#[test]
fn runtime_rotation_labels_are_stable() {
assert_eq!(super::rotation_label(ksp_logging_lib::FileRotation::Never), "never");
assert_eq!(super::rotation_label(ksp_logging_lib::FileRotation::Hourly), "hourly");
assert_eq!(super::rotation_label(ksp_logging_lib::FileRotation::Daily), "daily");
}
#[test]
fn runtime_count_projection_is_non_lossy_for_normal_values() {
assert_eq!(super::count_to_u64(0), 0);
assert_eq!(super::count_to_u64(42), 42);
}