From b9b342ff93ad3da659934ccb6dd3c15b6c2e9115 Mon Sep 17 00:00:00 2001 From: oxalica Date: Thu, 30 Apr 2020 12:54:12 +0800 Subject: Add tests of showing function qualifiers --- crates/ra_ide/src/hover.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 58c799eca..a62f598f0 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -844,4 +844,29 @@ fn func(foo: i32) { if true { <|>foo; }; } &["fn foo()\n```\n\n<- `\u{3000}` here"], ); } + + #[test] + fn test_hover_function_show_qualifiers() { + check_hover_result( + " + //- /lib.rs + async fn foo<|>() {} + ", + &["async fn foo()"], + ); + check_hover_result( + " + //- /lib.rs + pub const unsafe fn foo<|>() {} + ", + &["pub const unsafe fn foo()"], + ); + check_hover_result( + r#" + //- /lib.rs + pub(crate) async unsafe extern "C" fn foo<|>() {} + "#, + &[r#"pub(crate) async unsafe extern "C" fn foo()"#], + ); + } } -- cgit v1.2.3