mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
internal: move tests
This commit is contained in:
parent
0dc87badd7
commit
e838da18a9
2 changed files with 33 additions and 28 deletions
|
@ -562,3 +562,36 @@ fn f() -> i32 {
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_match_literal() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
macro_rules! m {
|
||||||
|
('(') => { fn l_paren() {} }
|
||||||
|
}
|
||||||
|
m!['('];
|
||||||
|
"#,
|
||||||
|
expect![[r#"
|
||||||
|
macro_rules! m {
|
||||||
|
('(') => { fn l_paren() {} }
|
||||||
|
}
|
||||||
|
fn l_paren() {}
|
||||||
|
"#]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_parse_macro_def_simple() {
|
||||||
|
cov_mark::check!(parse_macro_def_simple);
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
macro m($id:ident) { fn $id() {} }
|
||||||
|
m!(bar);
|
||||||
|
"#,
|
||||||
|
expect![[r#"
|
||||||
|
macro m($id:ident) { fn $id() {} }
|
||||||
|
fn bar() {}
|
||||||
|
"#]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -107,34 +107,6 @@ fn test_attr_to_token_tree() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_match_literal() {
|
|
||||||
parse_macro(
|
|
||||||
r#"
|
|
||||||
macro_rules! foo {
|
|
||||||
('(') => {
|
|
||||||
fn foo() {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"#,
|
|
||||||
)
|
|
||||||
.assert_expand_items("foo! ['('];", "fn foo () {}");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_parse_macro_def_simple() {
|
|
||||||
cov_mark::check!(parse_macro_def_simple);
|
|
||||||
|
|
||||||
parse_macro2(
|
|
||||||
r#"
|
|
||||||
macro foo($id:ident) {
|
|
||||||
fn $id() {}
|
|
||||||
}
|
|
||||||
"#,
|
|
||||||
)
|
|
||||||
.assert_expand_items("foo!(bar);", "fn bar () {}");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_macro_def_rules() {
|
fn test_parse_macro_def_rules() {
|
||||||
cov_mark::check!(parse_macro_def_rules);
|
cov_mark::check!(parse_macro_def_rules);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue