// This file is auto-generated by alef — DO NOT EDIT.
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
// To regenerate: alef generate
// To verify freshness: alef verify --exit-code
// Issues & docs: https://github.com/kreuzberg-dev/alef
//! E2e tests for category: mime_utilities

use kreuzberg::{detect_mime_type_from_bytes, get_extensions_for_mime};

#[test]
fn test_mime_detect_bytes() {
    // Detect MIME type from file bytes
    let content = std::fs::read(concat!(
        env!("CARGO_MANIFEST_DIR"),
        "/../../test_documents/pdf/fake_memo.pdf"
    ))
    .expect("test_documents/pdf/fake_memo.pdf must exist");
    let result = detect_mime_type_from_bytes(&content).expect("should succeed");
    assert!(
        format!("{:?}", result).contains(r#"pdf"#),
        "expected to contain: {}",
        r#"pdf"#
    );
}

#[test]
fn test_mime_detect_image() {
    // Detect MIME type from PNG image bytes
    let content = std::fs::read(concat!(
        env!("CARGO_MANIFEST_DIR"),
        "/../../test_documents/images/test_hello_world.png"
    ))
    .expect("test_documents/images/test_hello_world.png must exist");
    let result = detect_mime_type_from_bytes(&content).expect("should succeed");
    assert!(
        format!("{:?}", result).contains(r#"png"#),
        "expected to contain: {}",
        r#"png"#
    );
}

#[test]
fn test_mime_get_extensions() {
    // Get file extensions for a MIME type
    let mime_type = r#"application/pdf"#;
    let result = get_extensions_for_mime(mime_type).expect("should succeed");
    assert!(
        format!("{:?}", result).contains(r#"pdf"#),
        "expected to contain: {}",
        r#"pdf"#
    );
}
