Skip to content

Commit 712814d

Browse files
committed
[review] add use alias test examples
1 parent 8b59198 commit 712814d

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// rustfmt-skip_macro_invocations: ["aaa","ccc"]
2+
3+
// These tests demonstrate a realistic use case with use aliases.
4+
// The use statements should not impact functionality in any way.
5+
6+
use crate::{aaa, bbb, ddd};
7+
8+
// No use alias, invocation in list
9+
// Should skip this invocation
10+
aaa!(
11+
const _: u8 = 0;
12+
);
13+
14+
// Use alias, invocation in list
15+
// Should skip this invocation
16+
use crate::bbb as ccc;
17+
ccc!(
18+
const _: u8 = 0;
19+
);
20+
21+
// Use alias, invocation not in list
22+
// Should not skip this invocation
23+
use crate::ddd as eee;
24+
eee!(
25+
const _: u8 = 0;
26+
);
27+
28+
// No use alias, invocation not in list
29+
// Should not skip this invocation
30+
fff!(
31+
const _: u8 = 0;
32+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// rustfmt-skip_macro_invocations: ["aaa","ccc"]
2+
3+
// These tests demonstrate a realistic use case with use aliases.
4+
// The use statements should not impact functionality in any way.
5+
6+
use crate::{aaa, bbb, ddd};
7+
8+
// No use alias, invocation in list
9+
// Should skip this invocation
10+
aaa!(
11+
const _: u8 = 0;
12+
);
13+
14+
// Use alias, invocation in list
15+
// Should skip this invocation
16+
use crate::bbb as ccc;
17+
ccc!(
18+
const _: u8 = 0;
19+
);
20+
21+
// Use alias, invocation not in list
22+
// Should not skip this invocation
23+
use crate::ddd as eee;
24+
eee!(
25+
const _: u8 = 0;
26+
);
27+
28+
// No use alias, invocation not in list
29+
// Should not skip this invocation
30+
fff!(
31+
const _: u8 = 0;
32+
);

0 commit comments

Comments
 (0)