-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use assert_fs::prelude::*; | ||
use std::path::PathBuf; | ||
use std::fs; | ||
use screenpipe_vision::core::perform_ocr; // Adjust the import path | ||
|
||
#[test] | ||
fn test_ocr_output() -> Result<(), Box<dyn std::error::Error>> { | ||
println!("Starting test_ocr_output"); | ||
|
||
// Use the correct path to the testing_OCR.png file | ||
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||
path.push("tests/testing_OCR.png"); | ||
println!("Path to testing_OCR.png: {:?}", path); | ||
|
||
let image = image::open(&path).expect("Failed to open image"); | ||
let (text, tsv_output) = perform_ocr(&image); | ||
|
||
println!("OCR Text: {}", text); | ||
println!("TSV Output: {}", tsv_output); | ||
|
||
assert!(!text.is_empty(), "OCR text should not be empty"); | ||
assert!(!tsv_output.is_empty(), "TSV output should not be empty"); | ||
|
||
Ok(()) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.