Add tests for the One and Crate variants

This commit is contained in:
Stéphane Campinas 2022-02-02 15:43:31 +01:00 committed by Caleb Cartwright
parent b2c7a52ea8
commit fd6e11cc57
6 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,14 @@
// rustfmt-imports_granularity: Crate
use foo::a;
use foo::a;
use foo::b;
use foo::b as b2;
use foo::b::f;
use foo::b::g;
use foo::b::g as g2;
use foo::c;
use foo::d::e;
use qux::h;
use qux::h as h2;
use qux::i;

15
tests/source/5131_one.rs Normal file
View File

@ -0,0 +1,15 @@
// rustfmt-imports_granularity: One
pub use foo::x;
pub use foo::x as x2;
pub use foo::y;
use bar::a;
use bar::b;
use bar::b::f;
use bar::b::f as f2;
use bar::b::g;
use bar::c;
use bar::d::e;
use bar::d::e as e2;
use qux::h;
use qux::i;

View File

@ -0,0 +1,9 @@
// rustfmt-imports_granularity: Crate
use foo::{
a, b, b as b2,
b::{f, g, g as g2},
c,
d::e,
};
use qux::{h, h as h2, i};

12
tests/target/5131_one.rs Normal file
View File

@ -0,0 +1,12 @@
// rustfmt-imports_granularity: One
pub use foo::{x, x as x2, y};
use {
bar::{
a,
b::{self, f, g},
c,
d::{e, e as e2},
},
qux::{h, i},
};