updated tests
This commit is contained in:
parent
9b619035b9
commit
33d4ab65e8
1 changed files with 14 additions and 17 deletions
|
@ -230,29 +230,26 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn only_expand_allowed_builtin_macro() {
|
fn expand_allowed_builtin_macro() {
|
||||||
let fail_tests = [r#"
|
check(
|
||||||
//- 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#"
|
r#"
|
||||||
//- minicore: concat
|
//- minicore: concat
|
||||||
$0concat!("test", 10, 'b', true);"#,
|
$0concat!("test", 10, 'b', true);"#,
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
concat!
|
concat!
|
||||||
"test10btrue""#]],
|
"test10btrue""#]],
|
||||||
)];
|
);
|
||||||
for (test, expect) in tests {
|
}
|
||||||
check(test, expect);
|
|
||||||
}
|
#[test]
|
||||||
|
fn do_not_expand_disallowed_macro() {
|
||||||
|
let (analysis, pos) = fixture::position(
|
||||||
|
r#"
|
||||||
|
//- minicore: asm
|
||||||
|
$0asm!("0x300, x0");"#,
|
||||||
|
);
|
||||||
|
let expansion = analysis.expand_macro(pos).unwrap();
|
||||||
|
assert!(expansion.is_none());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue