From 546be18e3a91e4844b0dacc76c9f055397b6d89e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 13 Jun 2021 12:33:08 +0300 Subject: internal: check that coverage marks are always paired --- crates/hir_def/src/body/tests/block.rs | 10 +++++----- crates/ide_completion/src/render.rs | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'crates') diff --git a/crates/hir_def/src/body/tests/block.rs b/crates/hir_def/src/body/tests/block.rs index bc3d0f138..15c10d053 100644 --- a/crates/hir_def/src/body/tests/block.rs +++ b/crates/hir_def/src/body/tests/block.rs @@ -163,14 +163,14 @@ fn legacy_macro_items() { // correctly. check_at( r#" -macro_rules! hit { +macro_rules! mark { () => { struct Hit {} } } fn f() { - hit!(); + mark!(); $0 } "#, @@ -193,20 +193,20 @@ use core::cov_mark; fn f() { fn nested() { - cov_mark::hit!(Hit); + cov_mark::mark!(Hit); $0 } } //- /core.rs crate:core pub mod cov_mark { #[macro_export] - macro_rules! _hit { + macro_rules! _mark { ($name:ident) => { struct $name {} } } - pub use crate::_hit as hit; + pub use crate::_mark as mark; } "#, expect![[r#" diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs index a55081631..d8ca18c73 100644 --- a/crates/ide_completion/src/render.rs +++ b/crates/ide_completion/src/render.rs @@ -1007,6 +1007,7 @@ fn go(world: &WorldSnapshot) { go(w$0) } #[test] fn too_many_arguments() { + cov_mark::check!(too_many_arguments); check_relevance( r#" struct Foo; -- cgit v1.2.3