11180: minor: add missing test r=matklad a=matklad

This test kills the following mutant:

diff --git a/crates/mbe/src/tt_iter.rs b/crates/mbe/src/tt_iter.rs
index 9d2b1da9a..055d9a733 100644
--- a/crates/mbe/src/tt_iter.rs
+++ b/crates/mbe/src/tt_iter.rs
`@@` -134,7 +134,7 `@@` impl<'a> TtIter<'a> {
         self.inner = self.inner.as_slice()[res.len()..].iter();
         let res = match res.len() {
             1 => Some(res[0].cloned()),
-            0 => None,
+            // 0 => None,
             _ => Some(tt::TokenTree::Subtree(tt::Subtree {
                 delimiter: None,
                 token_trees: res.into_iter().map(|it| it.cloned()).collect(),

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2022-01-03 14:22:37 +00:00 committed by GitHub
commit 1ba9a924d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,3 +122,17 @@ stringify!(.. .. ..|);
"#]],
);
}
#[test]
fn trailing_vis() {
check(
r#"
macro_rules! m { ($($i:ident)? $vis:vis) => () }
m!(x pub);
"#,
expect![[r#"
macro_rules! m { ($($i:ident)? $vis:vis) => () }
"#]],
)
}