summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc/bad-codeblock-syntax.rs
blob: 9ec089fd7ad1386437fa75f8e5a6331d2e6037ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#![allow(rustdoc::invalid_rust_codeblocks)]

// @has bad_codeblock_syntax/fn.foo.html
// @has - '//*[@class="docblock"]' '\_'
/// ```
/// \_
/// ```
pub fn foo() {}

// @has bad_codeblock_syntax/fn.bar.html
// @has - '//*[@class="docblock"]' '`baz::foobar`'
/// ```
/// `baz::foobar`
/// ```
pub fn bar() {}

// @has bad_codeblock_syntax/fn.quux.html
// @has - '//*[@class="docblock"]' '\_'
/// ```rust
/// \_
/// ```
pub fn quux() {}

// @has bad_codeblock_syntax/fn.ok.html
// @has - '//*[@class="docblock"]' '\_'
/// ```text
/// \_
/// ```
pub fn ok() {}

// @has bad_codeblock_syntax/fn.escape.html
// @has - '//*[@class="docblock"]' '\_ <script>alert("not valid Rust");</script>'
/// ```
/// \_
/// <script>alert("not valid Rust");</script>
/// ```
pub fn escape() {}

// @has bad_codeblock_syntax/fn.unterminated.html
// @has - '//*[@class="docblock"]' '"unterminated'
/// ```
/// "unterminated
/// ```
pub fn unterminated() {}