Added some unit tests as requested

As discussed in PR #78267, for example:

* https://github.com/rust-lang/rust/pull/78267#discussion_r515404722
* https://github.com/rust-lang/rust/pull/78267#discussion_r515405958
This commit is contained in:
Rich Kadel
2020-11-02 21:32:48 -08:00
parent 5404efc28a
commit bd0eb07af2
10 changed files with 687 additions and 22 deletions

View File

@@ -0,0 +1,12 @@
[package]
authors = ["The Rust Project Developers"]
name = "coverage_test_macros"
version = "0.0.0"
edition = "2018"
[lib]
proc-macro = true
doctest = false
[dependencies]
proc-macro2 = "1"

View File

@@ -0,0 +1,8 @@
use proc_macro::TokenStream;
#[proc_macro]
pub fn let_bcb(item: TokenStream) -> TokenStream {
format!("let bcb{} = graph::BasicCoverageBlock::from_usize({}); let _ = {};", item, item, item)
.parse()
.unwrap()
}