mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Move doc_links tests from hover to doc_links
This commit is contained in:
parent
a35687fe1f
commit
bb71ebb985
2 changed files with 72 additions and 383 deletions
|
@ -602,6 +602,78 @@ trait Trait$0 {
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rewrite_html_root_url() {
|
||||
check_rewrite(
|
||||
r#"
|
||||
#![doc(arbitrary_attribute = "test", html_root_url = "https:/example.com", arbitrary_attribute2)]
|
||||
|
||||
pub mod foo {
|
||||
pub struct Foo;
|
||||
}
|
||||
/// [Foo](foo::Foo)
|
||||
pub struct B$0ar
|
||||
"#,
|
||||
expect"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rewrite_on_field() {
|
||||
// FIXME: Should be
|
||||
// [Foo](https://docs.rs/test/*/test/struct.Foo.html)
|
||||
check_rewrite(
|
||||
r#"
|
||||
pub struct Foo {
|
||||
/// [Foo](struct.Foo.html)
|
||||
fie$0ld: ()
|
||||
}
|
||||
"#,
|
||||
expect"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rewrite_struct() {
|
||||
check_rewrite(
|
||||
r#"
|
||||
/// [Foo]
|
||||
pub struct $0Foo;
|
||||
"#,
|
||||
expect"#]],
|
||||
);
|
||||
check_rewrite(
|
||||
r#"
|
||||
/// [`Foo`]
|
||||
pub struct $0Foo;
|
||||
"#,
|
||||
expect"#]],
|
||||
);
|
||||
check_rewrite(
|
||||
r#"
|
||||
/// [Foo](struct.Foo.html)
|
||||
pub struct $0Foo;
|
||||
"#,
|
||||
expect"#]],
|
||||
);
|
||||
check_rewrite(
|
||||
r#"
|
||||
/// [struct Foo](struct.Foo.html)
|
||||
pub struct $0Foo;
|
||||
"#,
|
||||
expect"#]],
|
||||
);
|
||||
check_rewrite(
|
||||
r#"
|
||||
/// [my Foo][foo]
|
||||
///
|
||||
/// [foo]: Foo
|
||||
pub struct $0Foo;
|
||||
"#,
|
||||
expect"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rewrite() {
|
||||
check_rewrite(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue