diff options
| author | Johann Hemmann <johann.hemmann@code.berlin> | 2024-01-09 14:52:40 +0100 |
|---|---|---|
| committer | Johann Hemmann <johann.hemmann@code.berlin> | 2024-01-18 12:59:43 +0100 |
| commit | bfc2e568dd862827b987ef979f4b2f04638beb7a (patch) | |
| tree | 793f7651e9f2cebf0fa817d1b82fb64f6c500a53 | |
| parent | f913d4f4b7adabc55f646a0d1e138b64751e1ebe (diff) | |
| download | rust-bfc2e568dd862827b987ef979f4b2f04638beb7a.tar.gz rust-bfc2e568dd862827b987ef979f4b2f04638beb7a.zip | |
Add tests for intra-doc links
The first one succeeds because the functionality is already implemented. The second one fails and represents the functionality to be implemented in this PR.
| -rw-r--r-- | crates/ide/src/doc_links/tests.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/ide/src/doc_links/tests.rs b/crates/ide/src/doc_links/tests.rs index e1f5ccc228b..37da3d6514d 100644 --- a/crates/ide/src/doc_links/tests.rs +++ b/crates/ide/src/doc_links/tests.rs @@ -664,3 +664,29 @@ pub struct $0Foo; expect![["[`foo`]"]], ); } + +#[test] +fn rewrite_intra_doc_link() { + check_rewrite( + r#" + //- minicore: eq, derive + //- /main.rs crate:foo + //! $0[PartialEq] + fn main() {} + "#, + expect"], + ); +} + +#[test] +fn rewrite_intra_doc_link_with_anchor() { + check_rewrite( + r#" + //- minicore: eq, derive + //- /main.rs crate:foo + //! $0[PartialEq#derivable] + fn main() {} + "#, + expect"], + ); +} |
