diff options
| author | bors <bors@rust-lang.org> | 2022-12-12 16:00:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-12-12 16:00:14 +0000 |
| commit | 69f9c33d71c871fc16ac445211281c6e7a340943 (patch) | |
| tree | 348cdcec6049f68be8c2618d727b2facd1ccb857 /src/librustdoc/html/markdown/tests.rs | |
| parent | 0040709e39bfa159d099ee14628ad4ac72f91406 (diff) | |
| parent | c9aa73c3b141d04aeffe7ff359f0fe2d642ff2b1 (diff) | |
| download | rust-1.66.0.tar.gz rust-1.66.0.zip | |
Auto merge of #105563 - pietroalbini:pa-stable-1.66.0, r=pietroalbini 1.66.0
[stable] Prepare 1.66.0 release This PR prepares the artifacts for the 1.66.0 release. The following PRs have been backported: * #104782 * #105023 * #104558 * #104610 * #103989 * #104650 * #105539 * #105477 r? `@ghost`
Diffstat (limited to 'src/librustdoc/html/markdown/tests.rs')
| -rw-r--r-- | src/librustdoc/html/markdown/tests.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/librustdoc/html/markdown/tests.rs b/src/librustdoc/html/markdown/tests.rs index e4f72a05789..68b31a6ee08 100644 --- a/src/librustdoc/html/markdown/tests.rs +++ b/src/librustdoc/html/markdown/tests.rs @@ -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>", + ); +} |
