mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
internal: move tests
This commit is contained in:
parent
49f5fecf06
commit
1abe3f8275
@ -151,3 +151,23 @@ type qual: ::T = qual::T;
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn broken_parenthesis_sequence() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m1 { ($x:ident) => { ($x } }
|
||||
macro_rules! m2 { ($x:ident) => {} }
|
||||
|
||||
m1!();
|
||||
m2!(x
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m1 { ($x:ident) => { ($x } }
|
||||
macro_rules! m2 { ($x:ident) => {} }
|
||||
|
||||
/* error: Failed to find macro definition */
|
||||
/* error: Failed to lower macro args to token tree */
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
@ -821,12 +821,4 @@ mod tests {
|
||||
let tt = syntax_node_to_token_tree(token_tree.syntax()).0;
|
||||
assert_eq!(tt.delimiter_kind(), Some(tt::DelimiterKind::Brace));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_missing_closing_delim() {
|
||||
let source_file = ast::SourceFile::parse("m!(x").tree();
|
||||
let node = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap();
|
||||
let tt = syntax_node_to_token_tree(node.syntax()).0.to_string();
|
||||
assert_eq_text!(&*tt, "( x");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user