Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

49
e2e/rust/tests/detection_test.rs generated Normal file
View File

@@ -0,0 +1,49 @@
// 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: detection
use kreuzberg::{detect_mime_type_from_bytes, get_extensions_for_mime};
#[test]
fn test_detect_mime_bytes_html() {
// Detect HTML MIME from bytes
let content = std::fs::read(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../test_documents/html/html.html"
))
.expect("test_documents/html/html.html must exist");
let _ = detect_mime_type_from_bytes(&content).expect("should succeed");
}
#[test]
fn test_detect_mime_bytes_pdf() {
// Detect PDF MIME type from 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 _ = detect_mime_type_from_bytes(&content).expect("should succeed");
}
#[test]
fn test_detect_mime_bytes_png() {
// Detect PNG MIME type from 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 _ = detect_mime_type_from_bytes(&content).expect("should succeed");
}
#[test]
fn test_get_extensions_unknown_mime() {
// get_extensions unknown MIME
let mime_type = r#"application/x-totally-unknown"#;
let result = get_extensions_for_mime(mime_type);
assert!(result.is_err(), "expected call to fail");
}