// 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: code

use kreuzberg::extract_file_sync;

#[test]
fn test_code_shebang_detection() {
    // Test language detection from shebang line via bytes input
    let path: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../test_documents/", "code/script.sh");
    let mime_type = Some(r#"text/x-source-code"#);
    let config = Default::default();
    let result = extract_file_sync(path, mime_type.as_deref(), &config).expect("should succeed");
    assert_eq!(
        result.mime_type.to_string().as_str().trim(),
        r#"text/x-source-code"#,
        "equals assertion failed"
    );
    assert!(
        result.content.len() >= 10,
        "expected length >= 10, got {}",
        result.content.len()
    );
    assert!(
        format!("{:?}", result.content).contains(r#"build"#),
        "expected to contain: {}",
        r#"build"#
    );
    assert!(
        format!("{:?}", result.content).contains(r#"clean"#),
        "expected to contain: {}",
        r#"clean"#
    );
}
