use ocr::api::Ocr;
use ocr::utils::Result;
use std::path::Path;
#[tokio::test]
async fn test_ocr_with_sample_image() -> Result<()> {
let test_image = Path::new("test_images/sample.png");
if !test_image.exists() {
eprintln!("Test image not found: {:?}", test_image);
eprintln!("Skipping OCR test - please create a test image first");
return Ok(());
}
println!("Testing OCR with image: {:?}", test_image);
let ocr = Ocr::new()?;
ocr.initialize().await?;
let result = ocr.recognize_text_from_file(test_image).await?;
println!("Recognized text: {}", result.text);
println!("Confidence: {:.2}%", result.confidence * 100.0);
assert!(
!result.text.is_empty() || result.words.is_empty(),
"OCR should return some result"
);
Ok(())
}