Add tests for nested imports

This commit is contained in:
Seiichi Uchida 2017-12-09 16:43:06 +09:00
parent 97fd517593
commit d4a569848e
2 changed files with 26 additions and 0 deletions

View File

@ -76,3 +76,14 @@ fn test() {
// We shouldn't remove imports which have attributes attached (#1858)
#[cfg(unix)]
use self::unix::{};
// nested imports
use foo::{a, bar::{baz, qux, xxxxxxxxxxx, yyyyyyyyyyyyy, zzzzzzzzzzzzzzzz, foo::{a, b, cxxxxxxxxxxxxx, yyyyyyyyyyyyyy, zzzzzzzzzzzzzzzz}}, b, boo, c,};
use fooo::{baar::{foobar::{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz}}, z, bar, bar::*, x, y};
// nested imports with a single sub-tree.
use a::{b::{c::*}};
use a::{b::{c::{}}};
use a::{b::{c::d}};
use a::{b::{c::{xxx, yyy, zzz}}};

View File

@ -71,3 +71,18 @@ fn test() {
// We shouldn't remove imports which have attributes attached (#1858)
#[cfg(unix)]
use self::unix::{};
// nested imports
use foo::{a, b, boo, c,
bar::{baz, qux, xxxxxxxxxxx, yyyyyyyyyyyyy, zzzzzzzzzzzzzzzz,
foo::{a, b, cxxxxxxxxxxxxx, yyyyyyyyyyyyyy, zzzzzzzzzzzzzzzz}}};
use fooo::{bar, x, y, z,
baar::foobar::{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz},
bar::*};
// nested imports with a single sub-tree.
use a::b::c::*;
use a::b::c::d;
use a::b::c::{xxx, yyy, zzz};