mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
added tests
This commit is contained in:
parent
5d5f68af3f
commit
7c37e57426
1 changed files with 26 additions and 0 deletions
|
@ -228,6 +228,32 @@ mod tests {
|
||||||
expect.assert_eq(&actual);
|
expect.assert_eq(&actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn only_expand_allowed_builtin_macro() {
|
||||||
|
let fail_tests = [r#"
|
||||||
|
//- minicore: asm
|
||||||
|
$0asm!("0x300, x0");
|
||||||
|
"#];
|
||||||
|
|
||||||
|
for test in fail_tests {
|
||||||
|
let (analysis, pos) = fixture::position(test);
|
||||||
|
let expansion = analysis.expand_macro(pos).unwrap();
|
||||||
|
assert!(expansion.is_none());
|
||||||
|
}
|
||||||
|
|
||||||
|
let tests = [(
|
||||||
|
r#"
|
||||||
|
//- minicore: concat
|
||||||
|
$0concat!("test", 10, 'b', true);"#,
|
||||||
|
expect![[r#"
|
||||||
|
concat!
|
||||||
|
"test10btrue""#]],
|
||||||
|
)];
|
||||||
|
for (test, expect) in tests {
|
||||||
|
check(test, expect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn macro_expand_as_keyword() {
|
fn macro_expand_as_keyword() {
|
||||||
check(
|
check(
|
||||||
|
|
Loading…
Reference in a new issue