Skip to content

Commit

Permalink
add test for 3984
Browse files Browse the repository at this point in the history
This is fixed by backporting 3999
  • Loading branch information
ytmimi committed Jul 21, 2022
1 parent ec54d65 commit 69f2d1d
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/source/issue-3984/imports_granularity_crate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: Crate

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item /* comment */;
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};
15 changes: 15 additions & 0 deletions tests/source/issue-3984/imports_granularity_item.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: Item

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item /* comment */;
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};
15 changes: 15 additions & 0 deletions tests/source/issue-3984/imports_granularity_module.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: Module

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item /* comment */;
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};
15 changes: 15 additions & 0 deletions tests/source/issue-3984/imports_granularity_one.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: One

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item /* comment */;
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};
15 changes: 15 additions & 0 deletions tests/source/issue-3984/imports_granularity_preserve.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: Preserve

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item /* comment */;
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};
15 changes: 15 additions & 0 deletions tests/target/issue-3984/imports_granularity_crate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: Crate

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item; /* comment */
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};
15 changes: 15 additions & 0 deletions tests/target/issue-3984/imports_granularity_item.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: Item

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item; /* comment */
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};
15 changes: 15 additions & 0 deletions tests/target/issue-3984/imports_granularity_module.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: Module

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item; /* comment */
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};
15 changes: 15 additions & 0 deletions tests/target/issue-3984/imports_granularity_one.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: One

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item; /* comment */
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};
15 changes: 15 additions & 0 deletions tests/target/issue-3984/imports_granularity_preserve.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// rustfmt-imports_granularity: Preserve

// See https://github.com/rust-lang/rustfmt/issues/3984
use a::{item /* comment */};
use b::{
a,
// comment
item,
};
use c::item; /* comment */
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________

use std::e::{/* it's a comment! */ bar /* and another */};
use std::f::{/* it's a comment! */ bar};
use std::g::{bar /* and another */};

0 comments on commit 69f2d1d

Please sign in to comment.