Skip to content

Commit 217cb8a

Browse files
committed
[review] add lots more tests
1 parent bdc6924 commit 217cb8a

18 files changed

+124
-20
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// rustfmt-skip_macro_invocations: ["*"]
2+
3+
// Should skip this invocation
4+
items!(
5+
const _: u8 = 0;
6+
);
7+
8+
// Should skip this invocation
9+
renamed_items!(
10+
const _: u8 = 0;
11+
);
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
// rustfmt-skip_macro_invocations: ["*","items"]
22

3-
macro_rules! items {
4-
($($arg:item)*) => { $($arg)* };
5-
}
6-
73
// Should skip this invocation
84
items!(
95
const _: u8 = 0;
106
);
117

128
// Should also skip this invocation, as the wildcard covers it
13-
use self::items as renamed_items;
149
renamed_items!(
1510
const _: u8 = 0;
1611
);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// rustfmt-skip_macro_invocations: []
2+
3+
// Should not skip this invocation
4+
items!(
5+
const _: u8 = 0;
6+
);
7+
8+
// Should not skip this invocation
9+
renamed_items!(
10+
const _: u8 = 0;
11+
);
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
// rustfmt-skip_macro_invocations: ["items"]
22

3-
macro_rules! items {
4-
($($arg:item)*) => { $($arg)* };
5-
}
6-
73
// Should skip this invocation
84
items!(
95
const _: u8 = 0;
106
);
117

128
// Should not skip this invocation
13-
use self::items as renamed_items;
149
renamed_items!(
1510
const _: u8 = 0;
1611
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-skip_macro_invocations: ["unknown"]
2+
3+
// Should not skip this invocation
4+
items!(
5+
const _: u8 = 0;
6+
);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// rustfmt-skip_macro_invocations: ["foo","bar"]
2+
3+
// Should skip this invocation
4+
foo!(
5+
const _: u8 = 0;
6+
);
7+
8+
// Should skip this invocation
9+
bar!(
10+
const _: u8 = 0;
11+
);
12+
13+
// Should not skip this invocation
14+
baz!(
15+
const _: u8 = 0;
16+
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-skip_macro_invocations: ["items"]
2+
3+
// Should not skip this invocation
4+
self::items!(
5+
const _: u8 = 0;
6+
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-skip_macro_invocations: ["self::items"]
2+
3+
// Should skip this invocation
4+
self::items!(
5+
const _: u8 = 0;
6+
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-skip_macro_invocations: ["self::items"]
2+
3+
// Should not skip this invocation
4+
items!(
5+
const _: u8 = 0;
6+
);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// rustfmt-skip_macro_invocations: ["*"]
2+
3+
// Should skip this invocation
4+
items!(
5+
const _: u8 = 0;
6+
);
7+
8+
// Should skip this invocation
9+
renamed_items!(
10+
const _: u8 = 0;
11+
);
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
// rustfmt-skip_macro_invocations: ["*","items"]
22

3-
macro_rules! items {
4-
($($arg:item)*) => { $($arg)* };
5-
}
6-
73
// Should skip this invocation
84
items!(
95
const _: u8 = 0;
106
);
117

128
// Should also skip this invocation, as the wildcard covers it
13-
use self::items as renamed_items;
149
renamed_items!(
1510
const _: u8 = 0;
1611
);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// rustfmt-skip_macro_invocations: []
2+
3+
// Should not skip this invocation
4+
items!(
5+
const _: u8 = 0;
6+
);
7+
8+
// Should not skip this invocation
9+
renamed_items!(
10+
const _: u8 = 0;
11+
);
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
// rustfmt-skip_macro_invocations: ["items"]
22

3-
macro_rules! items {
4-
($($arg:item)*) => { $($arg)* };
5-
}
6-
73
// Should skip this invocation
84
items!(
95
const _: u8 = 0;
106
);
117

128
// Should not skip this invocation
13-
use self::items as renamed_items;
149
renamed_items!(
1510
const _: u8 = 0;
1611
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-skip_macro_invocations: ["unknown"]
2+
3+
// Should not skip this invocation
4+
items!(
5+
const _: u8 = 0;
6+
);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// rustfmt-skip_macro_invocations: ["foo","bar"]
2+
3+
// Should skip this invocation
4+
foo!(
5+
const _: u8 = 0;
6+
);
7+
8+
// Should skip this invocation
9+
bar!(
10+
const _: u8 = 0;
11+
);
12+
13+
// Should not skip this invocation
14+
baz!(
15+
const _: u8 = 0;
16+
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-skip_macro_invocations: ["items"]
2+
3+
// Should not skip this invocation
4+
self::items!(
5+
const _: u8 = 0;
6+
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-skip_macro_invocations: ["self::items"]
2+
3+
// Should skip this invocation
4+
self::items!(
5+
const _: u8 = 0;
6+
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-skip_macro_invocations: ["self::items"]
2+
3+
// Should not skip this invocation
4+
items!(
5+
const _: u8 = 0;
6+
);

0 commit comments

Comments
 (0)