diff --git a/lib/entry/libimagentrymarkdown/src/processor.rs b/lib/entry/libimagentrymarkdown/src/processor.rs index ea85d7b9..2664a0f1 100644 --- a/lib/entry/libimagentrymarkdown/src/processor.rs +++ b/lib/entry/libimagentrymarkdown/src/processor.rs @@ -289,5 +289,25 @@ mod tests { } } + #[test] + fn test_process_one_existing_file_linked_faulty() { + setup_logging(); + let store = get_store(); + + let mut base = store.create(PathBuf::from("test-2.1")).unwrap(); + *base.get_content_mut() = format!("This is an example entry with one [link](/test-2.2)"); + + let update = store.update(&mut base); + assert!(update.is_ok()); + + let processor = LinkProcessor::default() + .process_internal_links(true) + .create_internal_targets(false) + .process_external_links(false) + .process_refs(false); + + let result = processor.process(&mut base, &store); + assert!(result.is_err(), "Should be Err(_), but is Ok(())"); + } }