webpage_quality_analyzer 1.0.2

High-performance webpage quality analyzer with 115 comprehensive metrics - Rust library with WASM, C++, and Python bindings
Documentation
/// Simple Phase 3 Compilation Test
/// Tests basic compilation of Phase 3 components
use crate::config::enhanced_models::{
    CategoryWeights, ContentExpectations, EnhancedScoringProfile, ProfileMetadata,
};
use crate::scoring::{ProfileAwareScorer, ProfileCompiler};
use std::collections::HashMap;

#[test]
fn test_phase3_basic_compilation() {
    // Create a simple profile with valid weights
    let mut profile = EnhancedScoringProfile::default();
    profile.metadata.name = "test_profile".to_string();

    // Set up valid category weights that sum to 1.0
    profile.category_weights.insert("content".to_string(), 0.4);
    profile
        .category_weights
        .insert("structure".to_string(), 0.2);
    profile.category_weights.insert("seo".to_string(), 0.2);
    profile
        .category_weights
        .insert("technical".to_string(), 0.1);
    profile
        .category_weights
        .insert("accessibility".to_string(), 0.1);

    // Test ProfileCompiler
    let compiler = ProfileCompiler::new();
    let result = compiler.compile_profile(&profile);
    if let Err(e) = &result {
        println!("Compilation error: {:?}", e);
    }
    assert!(
        result.is_ok(),
        "Profile compilation should succeed, got error: {:?}",
        result.err()
    );

    // Test ProfileAwareScorer creation
    let _scorer = ProfileAwareScorer::new();
    // Basic scorer creation should work
}

#[test]
fn test_phase3_module_structure() {
    // Test that all Phase 3 components can be imported
    use crate::scoring::{
        CompiledProfile, ContentValidationResult, ContentValidator, ProfileAwareScorer,
        ProfileCompiler, ScoringResult,
    };

    // If this compiles, the module structure is correct
    assert!(true);
}