Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/doc_links/tests.rs')
-rw-r--r--crates/ide/src/doc_links/tests.rs26
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 e1f5ccc228..37da3d6514 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!["[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)"],
+ );
+}