mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 02:43:45 +00:00
rustdoc: fix unit tests
This commit is contained in:
parent
dedf6fcde4
commit
51f335deca
@ -1,5 +1,5 @@
|
||||
use super::{find_testable_code, plain_text_summary, short_markdown_summary};
|
||||
use super::{ErrorCodes, HeadingOffset, IdMap, Ignore, LangString, Markdown, MarkdownHtml};
|
||||
use super::{ErrorCodes, HeadingOffset, IdMap, Ignore, LangString, Markdown, MarkdownItemInfo};
|
||||
use rustc_span::edition::{Edition, DEFAULT_EDITION};
|
||||
|
||||
#[test]
|
||||
@ -279,14 +279,13 @@ fn test_plain_text_summary() {
|
||||
fn test_markdown_html_escape() {
|
||||
fn t(input: &str, expect: &str) {
|
||||
let mut idmap = IdMap::new();
|
||||
let output =
|
||||
MarkdownHtml(input, &mut idmap, ErrorCodes::Yes, DEFAULT_EDITION, &None).into_string();
|
||||
let output = MarkdownItemInfo(input, &mut idmap).into_string();
|
||||
assert_eq!(output, expect, "original: {}", input);
|
||||
}
|
||||
|
||||
t("`Struct<'a, T>`", "<p><code>Struct<'a, T></code></p>\n");
|
||||
t("Struct<'a, T>", "<p>Struct<’a, T></p>\n");
|
||||
t("Struct<br>", "<p>Struct<br></p>\n");
|
||||
t("`Struct<'a, T>`", "<code>Struct<'a, T></code>");
|
||||
t("Struct<'a, T>", "Struct<’a, T>");
|
||||
t("Struct<br>", "Struct<br>");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user