mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 09:27:27 +00:00
move test
This commit is contained in:
parent
dce41e5a03
commit
0f849a7a35
2 changed files with 27 additions and 23 deletions
|
@ -23,3 +23,30 @@ literal!();
|
|||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_expand_bad_literal() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m { ($i:literal) => {}; }
|
||||
m!(&k");
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m { ($i:literal) => {}; }
|
||||
/* error: Failed to lower macro args to token tree */"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_empty_comments() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m{ ($fmt:expr) => (); }
|
||||
m!(/**/);
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m{ ($fmt:expr) => (); }
|
||||
/* error: expected Expr */
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -96,26 +96,3 @@ fn test_attr_to_token_tree() {
|
|||
Some(tt::DelimiterKind::Bracket)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_expand_bad_literal() {
|
||||
parse_macro(
|
||||
r#"
|
||||
macro_rules! foo { ($i:literal) => {}; }
|
||||
"#,
|
||||
)
|
||||
.assert_expand_err(r#"foo!(&k");"#, &ExpandError::BindingError("".into()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_empty_comments() {
|
||||
parse_macro(
|
||||
r#"
|
||||
macro_rules! one_arg_macro { ($fmt:expr) => (); }
|
||||
"#,
|
||||
)
|
||||
.assert_expand_err(
|
||||
r#"one_arg_macro!(/**/)"#,
|
||||
&ExpandError::BindingError("expected Expr".into()),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue