diff options
Diffstat (limited to 'src/test/rustdoc/bad-codeblock-syntax.rs')
-rw-r--r-- | src/test/rustdoc/bad-codeblock-syntax.rs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/test/rustdoc/bad-codeblock-syntax.rs b/src/test/rustdoc/bad-codeblock-syntax.rs new file mode 100644 index 000000000..9ec089fd7 --- /dev/null +++ b/src/test/rustdoc/bad-codeblock-syntax.rs @@ -0,0 +1,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() {} |