From fd5a1d1765801ef3bda447b849951631f61f1d25 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 9 May 2021 16:04:34 +0200 Subject: Test that none of the macros are reparsed --- crates/hir_def/src/nameres/tests/incremental.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/hir_def/src') diff --git a/crates/hir_def/src/nameres/tests/incremental.rs b/crates/hir_def/src/nameres/tests/incremental.rs index 227ecd162..d884a6eb4 100644 --- a/crates/hir_def/src/nameres/tests/incremental.rs +++ b/crates/hir_def/src/nameres/tests/incremental.rs @@ -137,6 +137,9 @@ m!(Z); }); let n_recalculated_item_trees = events.iter().filter(|it| it.contains("item_tree")).count(); assert_eq!(n_recalculated_item_trees, 6); + let n_reparsed_macros = + events.iter().filter(|it| it.contains("parse_macro_expansion")).count(); + assert_eq!(n_reparsed_macros, 3); } let new_text = r#" @@ -155,5 +158,8 @@ m!(Z); }); let n_recalculated_item_trees = events.iter().filter(|it| it.contains("item_tree")).count(); assert_eq!(n_recalculated_item_trees, 1); + let n_reparsed_macros = + events.iter().filter(|it| it.contains("parse_macro_expansion")).count(); + assert_eq!(n_reparsed_macros, 0); } } -- cgit v1.2.3