#[cfg(test)] use super::rst_parser::{parse_links, parse_images}; #[test] fn test_link_parser() { let mut input = String::from( "This is a paragraph that contains `a link`_. .. _a link: https://domain.invalida\n", ); let output = parse_links(&mut input).unwrap(); assert_eq!(output.trim_end(), "This is a paragraph that contains a link.") } #[test] fn test_image_parser() { let input = ".. image:: cool/image/123.png :width: 60% :height: auto :alt: this is the alt text "; let output = parse_images(input).unwrap(); assert_eq!(output.trim_end(), "\"this") }