mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
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.
This commit is contained in:
parent
f913d4f4b7
commit
bfc2e568dd
1 changed files with 26 additions and 0 deletions
|
@ -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!["[PartialEq](https://doc.rust-lang.org/stable/core/cmp/trait.PartialEq.html)"],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rewrite_intra_doc_link_with_anchor() {
|
||||
check_rewrite(
|
||||
r#"
|
||||
//- minicore: eq, derive
|
||||
//- /main.rs crate:foo
|
||||
//! $0[PartialEq#derivable]
|
||||
fn main() {}
|
||||
"#,
|
||||
expect!["[PartialEq#derivable](https://doc.rust-lang.org/stable/core/cmp/trait.PartialEq.html#derivable)"],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue