mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 08:53:35 +00:00
move test
This commit is contained in:
parent
7d92b9f6ff
commit
8670e83cec
@ -1290,3 +1290,23 @@ const VALUE: (bool, bool) = (true , false );
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_vis() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! m {
|
||||
($vis:vis $name:ident) => { $vis fn $name() {} }
|
||||
}
|
||||
m!(pub foo);
|
||||
m!(foo);
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro_rules! m {
|
||||
($vis:vis $name:ident) => { $vis fn $name() {} }
|
||||
}
|
||||
pub fn foo() {}
|
||||
fn foo() {}
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
@ -101,20 +101,6 @@ fn test_attr_to_token_tree() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_vis() {
|
||||
parse_macro(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($ vis:vis $ name:ident) => { $ vis fn $ name() {}};
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.assert_expand_items(r#"foo!(pub foo);"#, r#"pub fn foo () {}"#)
|
||||
// test optional cases
|
||||
.assert_expand_items(r#"foo!(foo);"#, r#"fn foo () {}"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_inner_macro_rules() {
|
||||
parse_macro(
|
||||
|
Loading…
Reference in New Issue
Block a user