Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/mbe/src/tests/expand.rs')
| -rw-r--r-- | crates/mbe/src/tests/expand.rs | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/crates/mbe/src/tests/expand.rs b/crates/mbe/src/tests/expand.rs index ffb24709f2..8a23a0be53 100644 --- a/crates/mbe/src/tests/expand.rs +++ b/crates/mbe/src/tests/expand.rs @@ -1,6 +1,5 @@ use ::parser::ParserEntryPoint; use syntax::{SyntaxKind::IDENT, T}; -use test_utils::assert_eq_text; use super::*; @@ -98,84 +97,6 @@ fn test_attr_to_token_tree() { ); } - -#[test] -fn test_no_space_after_semi_colon() { - let expanded = parse_macro( - r#" - macro_rules! with_std { ($($i:item)*) => ($(#[cfg(feature = "std")]$i)*) } - "#, - ) - .expand_items(r#"with_std! {mod m;mod f;}"#); - - let dump = format!("{:#?}", expanded); - assert_eq_text!( - r###"[email protected] - [email protected] "#" - [email protected] "[" - [email protected] "cfg" - [email protected] "(" - [email protected] "feature" - [email protected] "=" - [email protected] "\"std\"" - [email protected] ")" - [email protected] "]" - [email protected] "mod" - [email protected] "m" - [email protected] ";" - [email protected] "#" - [email protected] "[" - [email protected] "cfg" - [email protected] "(" - [email protected] "feature" - [email protected] "=" - [email protected] "\"std\"" - [email protected] ")" - [email protected] "]" - [email protected] "mod" - [email protected] "f" - [email protected] ";""###, - dump.trim() - ); -} - -// https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57597.rs -#[test] -fn test_rustc_issue_57597() { - fn test_error(fixture: &str) { - assert_eq!(parse_macro_error(fixture), ParseError::RepetitionEmptyTokenTree); - } - - test_error("macro_rules! foo { ($($($i:ident)?)+) => {}; }"); - test_error("macro_rules! foo { ($($($i:ident)?)*) => {}; }"); - test_error("macro_rules! foo { ($($($i:ident)?)?) => {}; }"); - test_error("macro_rules! foo { ($($($($i:ident)?)?)?) => {}; }"); - test_error("macro_rules! foo { ($($($($i:ident)*)?)?) => {}; }"); - test_error("macro_rules! foo { ($($($($i:ident)?)*)?) => {}; }"); - test_error("macro_rules! foo { ($($($($i:ident)?)?)*) => {}; }"); - test_error("macro_rules! foo { ($($($($i:ident)*)*)?) => {}; }"); - test_error("macro_rules! foo { ($($($($i:ident)?)*)*) => {}; }"); - test_error("macro_rules! foo { ($($($($i:ident)?)*)+) => {}; }"); - test_error("macro_rules! foo { ($($($($i:ident)+)?)*) => {}; }"); - test_error("macro_rules! foo { ($($($($i:ident)+)*)?) => {}; }"); -} - #[test] fn test_expand_bad_literal() { parse_macro( |