1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Tests for WASM handler
//! Split into submodules via include!() for file health compliance (CB-040)
//!
//! Submodules:
//! - wasm_handler_tests_helpers.rs: Test helper functions and mock builders
//! - wasm_handler_tests_file_io.rs: File I/O, analysis, verification, security, profiling tests
//! - wasm_handler_tests_failure_checks.rs: check_for_failures, check_verification_failure, etc.
//! - wasm_handler_tests_format_summary.rs: format_results, format_summary, append_* helpers, count, calculate
//! - wasm_handler_tests_format_detailed.rs: format_json, format_detailed, append_detailed_* tests
//! - wasm_handler_tests_sarif_and_metrics.rs: SARIF format and create_metrics_from_analysis tests
//! - wasm_handler_tests_integration.rs: End-to-end handle_analyze_wasm integration tests
use super::*;
mod property_tests {
use proptest::prelude::*;
proptest! {
#[test]
fn basic_property_stability(_input in ".*") {
// Basic property test for coverage
prop_assert!(true);
}
#[test]
fn module_consistency_check(_x in 0u32..1000) {
// Module consistency verification
prop_assert!(_x < 1001);
}
}
}
#[cfg_attr(coverage_nightly, coverage(off))]
#[cfg(test)]
mod coverage_tests {
use super::*;
use crate::wasm::baseline::{Severity as BaselineSeverity, Violation};
use crate::wasm::security::Severity;
use crate::wasm::{GrowthEvent, HotFunction, InstructionMix, MemoryProfile};
use std::io::Write;
use tempfile::NamedTempFile;
// Test helper functions and mock builders
include!("wasm_handler_tests_helpers.rs");
// File I/O, analysis, verification, security scan, profiling, baseline, write_output tests
include!("wasm_handler_tests_file_io.rs");
// check_for_failures, check_verification_failure, check_security_failures, check_baseline_failure
include!("wasm_handler_tests_failure_checks.rs");
// format_results, format_summary, append_* helpers, count_by_severity, calculate_percentage
include!("wasm_handler_tests_format_summary.rs");
// format_json, format_detailed, append_detailed_* tests
include!("wasm_handler_tests_format_detailed.rs");
// SARIF format functions and create_metrics_from_analysis tests
include!("wasm_handler_tests_sarif_and_metrics.rs");
// End-to-end integration tests for handle_analyze_wasm
include!("wasm_handler_tests_integration.rs");
}