about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2021-10-09 17:31:04 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2021-10-09 17:31:24 +0300
commita0d9e78ec34e614b9d5dcab44e579abc55c75cac (patch)
tree6abf8cfdc5a16e2f92a5100991196dbc5c1ac97d
parent036c0ff8c7c51cac4481d8f70280405d9a170ddc (diff)
downloadrust-a0d9e78ec34e614b9d5dcab44e579abc55c75cac.tar.gz
rust-a0d9e78ec34e614b9d5dcab44e579abc55c75cac.zip
align tests to code style
-rw-r--r--crates/hir_def/src/macro_expansion_tests/mbe.rs60
1 files changed, 30 insertions, 30 deletions
diff --git a/crates/hir_def/src/macro_expansion_tests/mbe.rs b/crates/hir_def/src/macro_expansion_tests/mbe.rs
index 8851028845f..36c1858a045 100644
--- a/crates/hir_def/src/macro_expansion_tests/mbe.rs
+++ b/crates/hir_def/src/macro_expansion_tests/mbe.rs
@@ -52,9 +52,9 @@ fn match_by_first_token_literally() {
     check(
         r#"
 macro_rules! m {
-    ($ i:ident) => ( mod $ i {} );
-    (= $ i:ident) => ( fn $ i() {} );
-    (+ $ i:ident) => ( struct $ i; )
+    ($i:ident) => ( mod $i {} );
+    (= $i:ident) => ( fn $i() {} );
+    (+ $i:ident) => ( struct $i; )
 }
 m! { foo }
 m! { = bar }
@@ -62,9 +62,9 @@ m! { + Baz }
 "#,
         expect![[r#"
 macro_rules! m {
-    ($ i:ident) => ( mod $ i {} );
-    (= $ i:ident) => ( fn $ i() {} );
-    (+ $ i:ident) => ( struct $ i; )
+    ($i:ident) => ( mod $i {} );
+    (= $i:ident) => ( fn $i() {} );
+    (+ $i:ident) => ( struct $i; )
 }
 mod foo {}
 fn bar() {}
@@ -78,9 +78,9 @@ fn match_by_last_token_literally() {
     check(
         r#"
 macro_rules! m {
-    ($ i:ident) => ( mod $ i {} );
-    ($ i:ident =) => ( fn $ i() {} );
-    ($ i:ident +) => ( struct $ i; )
+    ($i:ident) => ( mod $i {} );
+    ($i:ident =) => ( fn $i() {} );
+    ($i:ident +) => ( struct $i; )
 }
 m! { foo }
 m! { bar = }
@@ -88,9 +88,9 @@ m! { Baz + }
 "#,
         expect![[r#"
 macro_rules! m {
-    ($ i:ident) => ( mod $ i {} );
-    ($ i:ident =) => ( fn $ i() {} );
-    ($ i:ident +) => ( struct $ i; )
+    ($i:ident) => ( mod $i {} );
+    ($i:ident =) => ( fn $i() {} );
+    ($i:ident +) => ( struct $i; )
 }
 mod foo {}
 fn bar() {}
@@ -104,9 +104,9 @@ fn match_by_ident() {
     check(
         r#"
 macro_rules! m {
-    ($ i:ident) => ( mod $ i {} );
-    (spam $ i:ident) => ( fn $ i() {} );
-    (eggs $ i:ident) => ( struct $ i; )
+    ($i:ident) => ( mod $i {} );
+    (spam $i:ident) => ( fn $i() {} );
+    (eggs $i:ident) => ( struct $i; )
 }
 m! { foo }
 m! { spam bar }
@@ -114,9 +114,9 @@ m! { eggs Baz }
 "#,
         expect![[r#"
 macro_rules! m {
-    ($ i:ident) => ( mod $ i {} );
-    (spam $ i:ident) => ( fn $ i() {} );
-    (eggs $ i:ident) => ( struct $ i; )
+    ($i:ident) => ( mod $i {} );
+    (spam $i:ident) => ( fn $i() {} );
+    (eggs $i:ident) => ( struct $i; )
 }
 mod foo {}
 fn bar() {}
@@ -130,9 +130,9 @@ fn match_by_separator_token() {
     check(
         r#"
 macro_rules! m {
-    ($ ($ i:ident),*) => ($ ( mod $ i {} )*);
-    ($ ($ i:ident)#*) => ($ ( fn $ i() {} )*);
-    ($ i:ident ,# $ j:ident) => ( struct $ i; struct $ j; )
+    ($($i:ident),*) => ($(mod $i {} )*);
+    ($($i:ident)#*) => ($(fn $i() {} )*);
+    ($i:ident ,# $ j:ident) => ( struct $i; struct $ j; )
 }
 
 m! { foo, bar }
@@ -143,9 +143,9 @@ m! { Foo,# Bar }
 "#,
         expect![[r##"
 macro_rules! m {
-    ($ ($ i:ident),*) => ($ ( mod $ i {} )*);
-    ($ ($ i:ident)#*) => ($ ( fn $ i() {} )*);
-    ($ i:ident ,# $ j:ident) => ( struct $ i; struct $ j; )
+    ($($i:ident),*) => ($(mod $i {} )*);
+    ($($i:ident)#*) => ($(fn $i() {} )*);
+    ($i:ident ,# $ j:ident) => ( struct $i; struct $ j; )
 }
 
 mod foo {}
@@ -165,13 +165,13 @@ fn test_match_group_pattern_with_multiple_defs() {
     check(
         r#"
 macro_rules! m {
-    ($ ($ i:ident),*) => ( impl Bar { $ ( fn $ i {} )*} );
+    ($($i:ident),*) => ( impl Bar { $(fn $i {})* } );
 }
 m! { foo, bar }
 "#,
         expect![[r#"
 macro_rules! m {
-    ($ ($ i:ident),*) => ( impl Bar { $ ( fn $ i {} )*} );
+    ($($i:ident),*) => ( impl Bar { $(fn $i {})* } );
 }
 impl Bar {
 fn foo {}
@@ -186,13 +186,13 @@ fn test_match_group_pattern_with_multiple_statement() {
     check(
         r#"
 macro_rules! m {
-    ($ ($ i:ident),*) => ( fn baz { $ ( $ i (); )*} );
+    ($($i:ident),*) => ( fn baz { $($i ();)* } );
 }
 m! { foo, bar }
 "#,
         expect![[r#"
 macro_rules! m {
-    ($ ($ i:ident),*) => ( fn baz { $ ( $ i (); )*} );
+    ($($i:ident),*) => ( fn baz { $($i ();)* } );
 }
 fn baz {
 foo();
@@ -207,13 +207,13 @@ fn test_match_group_pattern_with_multiple_statement_without_semi() {
     check(
         r#"
 macro_rules! m {
-    ($ ($ i:ident),*) => ( fn baz { $ ( $i() );*} );
+    ($($i:ident),*) => ( fn baz { $($i() );* } );
 }
 m! { foo, bar }
 "#,
         expect![[r#"
 macro_rules! m {
-    ($ ($ i:ident),*) => ( fn baz { $ ( $i() );*} );
+    ($($i:ident),*) => ( fn baz { $($i() );* } );
 }
 fn baz {
 foo();