Skip to content

Commit fd6e11c

Browse files
scampicalebcartwright
authored andcommitted
Add tests for the One and Crate variants
1 parent b2c7a52 commit fd6e11c

File tree

6 files changed

+50
-0
lines changed

6 files changed

+50
-0
lines changed

tests/source/5131_crate.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// rustfmt-imports_granularity: Crate
2+
3+
use foo::a;
4+
use foo::a;
5+
use foo::b;
6+
use foo::b as b2;
7+
use foo::b::f;
8+
use foo::b::g;
9+
use foo::b::g as g2;
10+
use foo::c;
11+
use foo::d::e;
12+
use qux::h;
13+
use qux::h as h2;
14+
use qux::i;
File renamed without changes.

tests/source/5131_one.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: One
2+
3+
pub use foo::x;
4+
pub use foo::x as x2;
5+
pub use foo::y;
6+
use bar::a;
7+
use bar::b;
8+
use bar::b::f;
9+
use bar::b::f as f2;
10+
use bar::b::g;
11+
use bar::c;
12+
use bar::d::e;
13+
use bar::d::e as e2;
14+
use qux::h;
15+
use qux::i;

tests/target/5131_crate.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// rustfmt-imports_granularity: Crate
2+
3+
use foo::{
4+
a, b, b as b2,
5+
b::{f, g, g as g2},
6+
c,
7+
d::e,
8+
};
9+
use qux::{h, h as h2, i};
File renamed without changes.

tests/target/5131_one.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// rustfmt-imports_granularity: One
2+
3+
pub use foo::{x, x as x2, y};
4+
use {
5+
bar::{
6+
a,
7+
b::{self, f, g},
8+
c,
9+
d::{e, e as e2},
10+
},
11+
qux::{h, i},
12+
};

0 commit comments

Comments
 (0)