mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-19 10:24:16 +00:00
Add test for non-rust code block hashtag prepended lines
This commit is contained in:
parent
e81ad69331
commit
bc63c0edc0
@ -309,3 +309,40 @@ fn test_find_testable_code_line() {
|
||||
t("```rust\n```\n```rust\n```", &[1, 3]);
|
||||
t("```rust\n```\n ```rust\n```", &[1, 3]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ascii_with_prepending_hashtag() {
|
||||
fn t(input: &str, expect: &str) {
|
||||
let mut map = IdMap::new();
|
||||
let output = Markdown {
|
||||
content: input,
|
||||
links: &[],
|
||||
ids: &mut map,
|
||||
error_codes: ErrorCodes::Yes,
|
||||
edition: DEFAULT_EDITION,
|
||||
playground: &None,
|
||||
heading_offset: HeadingOffset::H2,
|
||||
}
|
||||
.into_string();
|
||||
assert_eq!(output, expect, "original: {}", input);
|
||||
}
|
||||
|
||||
t(
|
||||
r#"```ascii
|
||||
#..#.####.#....#.....##..
|
||||
#..#.#....#....#....#..#.
|
||||
####.###..#....#....#..#.
|
||||
#..#.#....#....#....#..#.
|
||||
#..#.#....#....#....#..#.
|
||||
#..#.####.####.####..##..
|
||||
```"#,
|
||||
"<div class=\"example-wrap\"><pre class=\"language-ascii\"><code>\
|
||||
#..#.####.#....#.....##..
|
||||
#..#.#....#....#....#..#.
|
||||
####.###..#....#....#..#.
|
||||
#..#.#....#....#....#..#.
|
||||
#..#.#....#....#....#..#.
|
||||
#..#.####.####.####..##..
|
||||
</code></pre></div>",
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user