Skip to content

Commit ea78227

Browse files
committed
Auto merge of #3932 - Turbo87:markdown-doc-test, r=JohnTitor
markdown: Add output assertion to the doc test This PR adjusts the doc comment of the `readme_to_html()` function by adding an assertion for the `rendered` result.
2 parents c346b95 + d40d484 commit ea78227

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/markdown/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ static MARKDOWN_EXTENSIONS: [&str; 7] =
246246
///
247247
/// let text = "[Rust](https://rust-lang.org/) is an awesome *systems programming* language!";
248248
/// let rendered = text_to_html(text, "README.md", None);
249+
/// assert_eq!(rendered, "<p><a href=\"https://rust-lang.org/\" rel=\"nofollow noopener noreferrer\">Rust</a> is an awesome <em>systems programming</em> language!</p>\n");
249250
/// ```
250251
pub fn text_to_html(text: &str, path: &str, base_url: Option<&str>) -> String {
251252
let path = Path::new(path);

0 commit comments

Comments
 (0)