1
Fork 0

Improve tests for #5852

This commit is contained in:
Robert Sammelson 2023-07-27 21:59:51 -04:00 committed by Yacin Tmimi
parent c7c57f8a16
commit b6367235eb
14 changed files with 874 additions and 0 deletions

View 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 */};

View 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*/,};

View 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*/,};

View 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
};

View 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*/,};

View 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*/,};

View 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 */};

View 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*/};

View 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*/};

View 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
};

View 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*/};

View 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*/
};