Unnamed repository; edit this file 'description' to name the repository.
add test for function pointer without identifier
Jeroen Vannevel 2022-02-16
parent c8cd7a6 · commit d985394
-rw-r--r--crates/ide/src/hover/tests.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs
index ed9f6d507c..85fe4cc964 100644
--- a/crates/ide/src/hover/tests.rs
+++ b/crates/ide/src/hover/tests.rs
@@ -1347,6 +1347,24 @@ fn test_hover_function_pointer_show_types() {
}
#[test]
+fn test_hover_function_pointer_no_identifier_show_types() {
+ check(
+ r#"type foo$0 = fn(i32, _: i32) -> i32;"#,
+ expect![[r#"
+ *foo*
+
+ ```rust
+ test
+ ```
+
+ ```rust
+ type foo = fn(i32, i32) -> i32
+ ```
+ "#]],
+ );
+}
+
+#[test]
fn test_hover_trait_show_qualifiers() {
check_actions(
r"unsafe trait foo$0() {}",