fixup tests

This commit is contained in:
Nick Cameron 2018-03-15 14:06:54 +13:00
parent 50c95a074a
commit fa75ef4663
8 changed files with 19 additions and 15 deletions

View File

@ -23,11 +23,11 @@
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::str::Chars; use std::str::Chars;
use rustfmt::*;
use rustfmt::config::{Color, Config, ReportTactic};
use rustfmt::config::summary::Summary; use rustfmt::config::summary::Summary;
use rustfmt::config::{Color, Config, ReportTactic};
use rustfmt::filemap::write_system_newlines; use rustfmt::filemap::write_system_newlines;
use rustfmt::rustfmt_diff::*; use rustfmt::rustfmt_diff::*;
use rustfmt::*;
const DIFF_CONTEXT_SIZE: usize = 3; const DIFF_CONTEXT_SIZE: usize = 3;
const CONFIGURATIONS_FILE_NAME: &str = "Configurations.md"; const CONFIGURATIONS_FILE_NAME: &str = "Configurations.md";

View File

@ -21,6 +21,7 @@
Foo, Bar /* comment */}; Foo, Bar /* comment */};
use Foo::{Bar, Baz}; use Foo::{Bar, Baz};
pub use syntax::ast::{Expr_, Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath}; pub use syntax::ast::{Expr_, Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath};
use syntax::some::{}; use syntax::some::{};
use self; use self;

View File

@ -1,4 +1,4 @@
use aaaaaaaaaaaaaaa::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
use aaaaaaaaaaaaaaa::{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccccc, dddddddd}; use aaaaaaaaaaaaaaa::{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccccc, dddddddd};
use aaaaaaaaaaaaaaa::{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccccc, use aaaaaaaaaaaaaaa::{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccccc,
ddddddddd}; ddddddddd};
use aaaaaaaaaaaaaaa::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

View File

@ -2,9 +2,9 @@
// rustfmt-reorder_imported_names: true // rustfmt-reorder_imported_names: true
use std::cmp::{a, b, c, d}; use std::cmp::{a, b, c, d};
use std::ddd::{a, b, c as g, d as p};
use std::ddd::aaa; use std::ddd::aaa;
// This comment should stay with `use std::ddd:bbb;` use std::ddd::{a, b, c as g, d as p};
use std::ddd::bbb;
/// This comment should stay with `use std::str;` /// This comment should stay with `use std::str;`
use std::str; use std::str;
// This comment should stay with `use std::ddd:bbb;`
use std::ddd::bbb;

View File

@ -2,29 +2,29 @@
use std::cmp::{a, b, c, d}; use std::cmp::{a, b, c, d};
use std::cmp::{b, e, f, g}; use std::cmp::{b, e, f, g};
use std::ddd::aaa;
use std::str;
// This comment should stay with `use std::ddd;` // This comment should stay with `use std::ddd;`
use std::ddd; use std::ddd;
use std::ddd::aaa;
use std::ddd::bbb; use std::ddd::bbb;
use std::str;
mod test {} mod test {}
use aaa; use aaa;
use aaa::*;
use aaa::bbb; use aaa::bbb;
use aaa::*;
mod test {} mod test {}
// If item names are equal, order by rename // If item names are equal, order by rename
use test::{a as aa, c};
use test::{a as bb, b}; use test::{a as bb, b};
use test::{a as aa, c};
mod test {} mod test {}
// If item names are equal, order by rename - no rename comes before a rename // If item names are equal, order by rename - no rename comes before a rename
use test::{a, c};
use test::{a as bb, b}; use test::{a as bb, b};
use test::{a, c};
mod test {} mod test {}
// `self` always comes first // `self` always comes first

View File

@ -19,10 +19,10 @@
use test::{/* A */ self /* B */, Other /* C */}; use test::{/* A */ self /* B */, Other /* C */};
use {Bar /* comment */, /* Pre-comment! */ Foo};
use Foo::{Bar, Baz}; use Foo::{Bar, Baz};
use syntax; use syntax;
pub use syntax::ast::{Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath, Expr_}; pub use syntax::ast::{Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath, Expr_};
use {Bar /* comment */, /* Pre-comment! */ Foo};
use self; use self;
use std::io; use std::io;
@ -54,8 +54,8 @@ fn test() {
use foo::{baz, qux as bar}; use foo::{baz, qux as bar};
// With absolute paths // With absolute paths
use foo;
use Foo; use Foo;
use foo;
use foo::Bar; use foo::Bar;
use foo::{Bar, Baz}; use foo::{Bar, Baz};
use {Bar, Baz}; use {Bar, Baz};

View File

@ -14,7 +14,9 @@ mod a {
use d; use d;
} }
use z;
use y;
use a; use a;
use x; use x;
use y;
use z;

View File

@ -2,6 +2,7 @@
use std::borrow::Cow; use std::borrow::Cow;
/* comment */ /* comment */
/* comment */ /* comment */
/* comment */ /* comment */