diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-02-19 14:47:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-19 14:47:55 +0100 |
| commit | bd63edc07aad0c3fa7300505cf45bacb6bfb650f (patch) | |
| tree | 87a2f833eeb71aafa899ae311952082a9c7d0a0e /tests | |
| parent | 49d7ed1dbef6744cd9a27fdae086c9b80fb4ed46 (diff) | |
| parent | 8d801fd3983d83ee701beb35b86d3d5b6540890e (diff) | |
| download | rust-bd63edc07aad0c3fa7300505cf45bacb6bfb650f.tar.gz rust-bd63edc07aad0c3fa7300505cf45bacb6bfb650f.zip | |
Rollup merge of #108129 - GuillaumeGomez:correctly-handle-links-starting-with-whitespace, r=petrochenkov
Correctly handle links starting with whitespace Part of https://github.com/rust-lang/rust/issues/107995. I just got this issue, wrote a fix and then saw the issue. So here's the PR. ^^' r? `@petrochenkov`
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rustdoc/issue-107995.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/rustdoc/issue-107995.rs b/tests/rustdoc/issue-107995.rs new file mode 100644 index 00000000000..1273e4fdd12 --- /dev/null +++ b/tests/rustdoc/issue-107995.rs @@ -0,0 +1,28 @@ +// Regression test for <https://github.com/rust-lang/rust/issues/107995>. + +#![crate_name = "foo"] + +// @has 'foo/fn.foo.html' +// @has - '//*[@class="docblock"]//a[@href="fn.bar.html"]' 'bar`' +/// A foo, see also [ bar`] +pub fn foo() {} + +// @has 'foo/fn.bar.html' +// @has - '//*[@class="docblock"]' 'line Path line' +// @has - '//*[@class="docblock"]//a[@href="struct.Path.html"]' 'Path' +#[doc = "line ["] +#[doc = "Path"] +#[doc = "] line"] +pub fn bar() {} + +// @has 'foo/fn.another.html' +// @has - '//*[@class="docblock"]//a[@href="struct.Path.html"]' 'Path' +/// [ `Path`] +pub fn another() {} + +// @has 'foo/fn.last.html' +// @has - '//*[@class="docblock"]//a[@href="struct.Path.html"]' 'Path' +/// [ Path`] +pub fn last() {} + +pub struct Path; |
