diff --git a/tests/unicode.rs b/tests/unicode.rs index 02ec4d2..03ee79b 100644 --- a/tests/unicode.rs +++ b/tests/unicode.rs @@ -126,6 +126,7 @@ fn get_text_from_first_page(doc: &Document) -> String { extracted_text } +#[cfg(not(feature = "async"))] #[test] fn unicode_can_be_extracted_from_loaded_pdf() -> lopdf::Result<()> { let doc = Document::load("assets/unicode.pdf")?; @@ -136,3 +137,12 @@ fn unicode_can_be_extracted_from_loaded_pdf() -> lopdf::Result<()> { assert_eq!(extracted_text.replace("\n", ""), "😀🔧🔨"); Ok(()) } + +#[cfg(feature = "async")] +#[tokio::test] +async fn unicode_can_be_extracted_from_loaded_pdf() -> lopdf::Result<()> { + let doc = Document::load("assets/unicode.pdf").await?; + let extracted_text = get_text_from_first_page(&doc); + assert_eq!(extracted_text.replace("\n", ""), "😀🔧🔨"); + Ok(()) +}