Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions crates/kreuzberg/tests/issue_359_list_whitespace_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//! Regression test for https://github.com/kreuzberg-dev/kreuzberg/issues/359
//!
//! DOCX list items with multiple text runs should preserve whitespace between runs.
//! e.g. "Sermocination ypsiliform" must not become "Sermocinationypsiliform".

#![cfg(feature = "office")]

use kreuzberg::{ExtractionConfig, extract_file};

#[tokio::test]
async fn test_issue_359_docx_list_run_whitespace() {
let workspace_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.expect("parent")
.parent()
.expect("workspace root");
let test_file = workspace_root.join("test_documents/docx/issue_359_list_whitespace.docx");

if !test_file.exists() {
println!("Skipping test: {:?} not found", test_file);
return;
}

let result = extract_file(&test_file, None, &ExtractionConfig::default())
.await
.expect("Should extract DOCX successfully");

assert!(
result.content.contains("Sermocination ypsiliform"),
"Expected 'Sermocination ypsiliform' with space between runs, got: {:?}",
result.content
);
}
Binary file not shown.
Loading