use super::*;

#[test]
fn smuggling_type_variants_distinct() {
    assert_ne!(SmugglingType::ClTe, SmugglingType::TeCl);
    assert_ne!(SmugglingType::TeCl, SmugglingType::TeTe);
    assert_ne!(SmugglingType::ClTe, SmugglingType::TeTe);
}

#[test]
fn https_supported_is_now_true() {
    assert!(supports_https());
}

#[tokio::test]
async fn detect_smuggling_returns_empty_for_invalid_url() {
    let results = detect_smuggling("not-a-url", Duration::from_millis(100)).await;
    assert!(results.is_empty(), "Invalid URL should return no results");
}

#[tokio::test]
async fn detect_smuggling_returns_empty_for_unreachable_host() {
    let results = detect_smuggling("http://192.0.2.1:1", Duration::from_millis(100)).await;
    assert!(
        results.is_empty(),
        "Unreachable host should return no results"
    );
}

#[test]
fn smuggling_result_evidence_is_descriptive() {
    let result = SmugglingResult {
        vulnerable: true,
        smuggling_type: SmugglingType::ClTe,
        evidence: "CL.TE vulnerability detected via timeout".to_string(),
    };
    assert!(result.evidence.contains("CL.TE"));
    assert!(result.vulnerable);
}
