aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-03-11 15:14:15 +0000
committerEdwin Cheng <[email protected]>2020-03-11 15:14:15 +0000
commit8c159b54e9617de4248f947db8cbe0272b640915 (patch)
treef0f5e072cf3323ad0546284ffacca9d2c237e04e /crates/ra_ide/src
parent759bcea96de448a7758276a9ce5696a56b44b465 (diff)
Add test on hover
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r--crates/ra_ide/src/hover.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index 89640efb6..0bbba4855 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -833,6 +833,25 @@ fn func(foo: i32) { if true { <|>foo; }; }
833 } 833 }
834 834
835 #[test] 835 #[test]
836 fn test_hover_through_assert_macro() {
837 let hover_on = check_hover_result(
838 r#"
839 //- /lib.rs
840 #[rustc_builtin_macro]
841 macro_rules! assert {}
842
843 fn bar() -> bool { true }
844 fn foo() {
845 assert!(ba<|>r());
846 }
847 "#,
848 &["fn bar() -> bool"],
849 );
850
851 assert_eq!(hover_on, "bar");
852 }
853
854 #[test]
836 fn test_hover_through_literal_string_in_builtin_macro() { 855 fn test_hover_through_literal_string_in_builtin_macro() {
837 check_hover_no_result( 856 check_hover_no_result(
838 r#" 857 r#"