From d985394ce2e5a7689e16fe1b940fc03adfb65805 Mon Sep 17 00:00:00 2001 From: Jeroen Vannevel Date: Tue, 15 Feb 2022 19:20:50 +0000 Subject: [PATCH] add test for function pointer without identifier --- crates/ide/src/hover/tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 @@ -1346,6 +1346,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(