From 06984ed1164d7607f89f9a6f4893dd05ec058a99 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Fri, 15 Nov 2019 17:13:52 -0500 Subject: Add a test that uses classify_name --- crates/ra_ide_api/src/references.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crates') diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide_api/src/references.rs index 9cb9433e7..faa88d988 100644 --- a/crates/ra_ide_api/src/references.rs +++ b/crates/ra_ide_api/src/references.rs @@ -369,6 +369,21 @@ mod tests { assert_eq!(refs.len(), 2); } + #[test] + fn test_find_all_refs_macro_def() { + let code = r#" + #[macro_export] + macro_rules! m1<|> { () => (()) } + + fn foo() { + m1(); + m1(); + }"#; + + let refs = get_all_refs(code); + assert_eq!(refs.len(), 3); + } + fn get_all_refs(text: &str) -> ReferenceSearchResult { let (analysis, position) = single_file_with_position(text); analysis.find_all_refs(position, None).unwrap().unwrap() -- cgit v1.2.3