payload-loader 0.1.0

Production-ready Rust loader with cryptography, configuration, and security features
Documentation
// Integration tests for loader

use loader::{OperationMetrics, Timer};
use std::time::Duration;

#[test]
fn test_validate_key_valid() {
    // This would need mal_dev_core available
    // For now, we test the metrics system
    let metrics = OperationMetrics::new("test_op", 1024, Duration::from_millis(100));
    assert_eq!(metrics.bytes_processed, 1024);
}

#[test]
fn test_metrics_logging() {
    let timer = Timer::start();
    std::thread::sleep(Duration::from_millis(5));
    let metrics = timer.stop_with_metrics("test_decrypt", 2048);
    
    assert!(metrics.duration.as_millis() >= 5);
    assert_eq!(metrics.bytes_processed, 2048);
}

#[test]
fn test_timer_precision() {
    let timer = Timer::start();
    std::thread::sleep(Duration::from_millis(10));
    let elapsed = timer.stop();
    
    assert!(elapsed.as_millis() >= 9, "Timer too fast");
    assert!(elapsed.as_millis() < 50, "Timer too slow");
}