Improve tests for #5852
This commit is contained in:
parent
c7c57f8a16
commit
b6367235eb
14 changed files with 874 additions and 0 deletions
12
tests/source/issue-3984.rs
Normal file
12
tests/source/issue-3984.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
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 */};
|
106
tests/source/issue-5852/horizontal.rs
Normal file
106
tests/source/issue-5852/horizontal.rs
Normal file
|
@ -0,0 +1,106 @@
|
|||
// rustfmt-imports_layout: Horizontal
|
||||
|
||||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self // this is important
|
||||
};
|
||||
|
||||
use foo :: bar
|
||||
;
|
||||
|
||||
use foo::{bar};
|
||||
|
||||
use foo::{
|
||||
bar
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
bar
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
self
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self // a
|
||||
,
|
||||
};
|
||||
|
||||
use foo::{ self /* a */ };
|
||||
|
||||
use foo::{ self /* a */, };
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc::{
|
||||
xyz
|
||||
// 123
|
||||
}
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
bar,
|
||||
abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
abc
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
abc,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
xyz
|
||||
// 123
|
||||
}
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
// 123
|
||||
xyz
|
||||
}
|
||||
};
|
||||
|
||||
use path::{self /*comment*/,};
|
106
tests/source/issue-5852/horizontal_vertical.rs
Normal file
106
tests/source/issue-5852/horizontal_vertical.rs
Normal file
|
@ -0,0 +1,106 @@
|
|||
// rustfmt-imports_layout: HorizontalVertical
|
||||
|
||||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self // this is important
|
||||
};
|
||||
|
||||
use foo :: bar
|
||||
;
|
||||
|
||||
use foo::{bar};
|
||||
|
||||
use foo::{
|
||||
bar
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
bar
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
self
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self // a
|
||||
,
|
||||
};
|
||||
|
||||
use foo::{ self /* a */ };
|
||||
|
||||
use foo::{ self /* a */, };
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc::{
|
||||
xyz
|
||||
// 123
|
||||
}
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
bar,
|
||||
abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
abc
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
abc,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
xyz
|
||||
// 123
|
||||
}
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
// 123
|
||||
xyz
|
||||
}
|
||||
};
|
||||
|
||||
use path::{self /*comment*/,};
|
8
tests/source/issue-5852/issue_example.rs
Normal file
8
tests/source/issue-5852/issue_example.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self // this is important
|
||||
};
|
111
tests/source/issue-5852/split.rs
Normal file
111
tests/source/issue-5852/split.rs
Normal file
|
@ -0,0 +1,111 @@
|
|||
// rustfmt-imports_granularity: Item
|
||||
|
||||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self // this is important
|
||||
};
|
||||
|
||||
use foo :: bar
|
||||
;
|
||||
|
||||
use foo::{bar};
|
||||
|
||||
use foo::{
|
||||
bar
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
bar
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
self
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self // a
|
||||
,
|
||||
};
|
||||
|
||||
use foo::{ self /* a */ };
|
||||
|
||||
use foo::{ self /* a */, };
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc::{
|
||||
xyz
|
||||
// 123
|
||||
}
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
bar,
|
||||
abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
abc
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
abc,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
xyz
|
||||
// 123
|
||||
}
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
// 123
|
||||
xyz
|
||||
}
|
||||
};
|
||||
|
||||
use path::{self /*comment*/,};
|
106
tests/source/issue-5852/vertical.rs
Normal file
106
tests/source/issue-5852/vertical.rs
Normal file
|
@ -0,0 +1,106 @@
|
|||
// rustfmt-imports_layout: Vertical
|
||||
|
||||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self // this is important
|
||||
};
|
||||
|
||||
use foo :: bar
|
||||
;
|
||||
|
||||
use foo::{bar};
|
||||
|
||||
use foo::{
|
||||
bar
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
bar
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
self
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self // a
|
||||
,
|
||||
};
|
||||
|
||||
use foo::{ self /* a */ };
|
||||
|
||||
use foo::{ self /* a */, };
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc::{
|
||||
xyz
|
||||
// 123
|
||||
}
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
bar,
|
||||
abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
abc
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
abc,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
xyz
|
||||
// 123
|
||||
}
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
// 123
|
||||
xyz
|
||||
}
|
||||
};
|
||||
|
||||
use path::{self /*comment*/,};
|
12
tests/target/issue-3984.rs
Normal file
12
tests/target/issue-3984.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
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 */};
|
99
tests/target/issue-5852/horizontal.rs
Normal file
99
tests/target/issue-5852/horizontal.rs
Normal file
|
@ -0,0 +1,99 @@
|
|||
// rustfmt-imports_layout: Horizontal
|
||||
|
||||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // this is important
|
||||
};
|
||||
|
||||
use foo::bar;
|
||||
|
||||
use foo::bar;
|
||||
|
||||
use foo::{
|
||||
bar, // abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
self,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // a
|
||||
};
|
||||
|
||||
use foo::{self /* a */};
|
||||
|
||||
use foo::{self /* a */};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc::{
|
||||
xyz, // 123
|
||||
},
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc,
|
||||
// abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc,
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc, // abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc,
|
||||
// abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
xyz, // 123
|
||||
},
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
// 123
|
||||
xyz,
|
||||
},
|
||||
};
|
||||
|
||||
use path::{self /*comment*/};
|
99
tests/target/issue-5852/horizontal_vertical.rs
Normal file
99
tests/target/issue-5852/horizontal_vertical.rs
Normal file
|
@ -0,0 +1,99 @@
|
|||
// rustfmt-imports_layout: HorizontalVertical
|
||||
|
||||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // this is important
|
||||
};
|
||||
|
||||
use foo::bar;
|
||||
|
||||
use foo::bar;
|
||||
|
||||
use foo::{
|
||||
bar, // abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
self,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // a
|
||||
};
|
||||
|
||||
use foo::{self /* a */};
|
||||
|
||||
use foo::{self /* a */};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc::{
|
||||
xyz, // 123
|
||||
},
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc,
|
||||
// abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc,
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc, // abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc,
|
||||
// abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
xyz, // 123
|
||||
},
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
// 123
|
||||
xyz,
|
||||
},
|
||||
};
|
||||
|
||||
use path::{self /*comment*/};
|
8
tests/target/issue-5852/issue_example.rs
Normal file
8
tests/target/issue-5852/issue_example.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // this is important
|
||||
};
|
102
tests/target/issue-5852/split.rs
Normal file
102
tests/target/issue-5852/split.rs
Normal file
|
@ -0,0 +1,102 @@
|
|||
// rustfmt-imports_granularity: Item
|
||||
|
||||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // this is important
|
||||
};
|
||||
|
||||
use foo::bar;
|
||||
|
||||
use foo::bar;
|
||||
|
||||
use foo::{
|
||||
bar, // abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
self,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // a
|
||||
};
|
||||
|
||||
use foo::{self /* a */};
|
||||
|
||||
use foo::{self /* a */};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc::{
|
||||
xyz, // 123
|
||||
},
|
||||
};
|
||||
|
||||
use foo::abc;
|
||||
use foo::bar;
|
||||
|
||||
use foo::{
|
||||
abc,
|
||||
// abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc,
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc, // abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc,
|
||||
// abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
xyz, // 123
|
||||
},
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
// 123
|
||||
xyz,
|
||||
},
|
||||
};
|
||||
|
||||
use path::{self /*comment*/};
|
105
tests/target/issue-5852/vertical.rs
Normal file
105
tests/target/issue-5852/vertical.rs
Normal file
|
@ -0,0 +1,105 @@
|
|||
// rustfmt-imports_layout: Vertical
|
||||
|
||||
use std::{
|
||||
fs,
|
||||
// (temporarily commented, we'll need this again in a second) io,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // this is important
|
||||
};
|
||||
|
||||
use foo::bar;
|
||||
|
||||
use foo::bar;
|
||||
|
||||
use foo::{
|
||||
bar, // abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
bar,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// 345
|
||||
self,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, // a
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, /* a */
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self, /* a */
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc::{
|
||||
xyz, // 123
|
||||
},
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc,
|
||||
// abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
// abc
|
||||
abc,
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc, // abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
abc,
|
||||
// abc
|
||||
bar,
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
xyz, // 123
|
||||
},
|
||||
};
|
||||
|
||||
use foo::{
|
||||
self,
|
||||
// abc
|
||||
abc::{
|
||||
// 123
|
||||
xyz,
|
||||
},
|
||||
};
|
||||
|
||||
use path::{
|
||||
self, /*comment*/
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue