Skip to content

Commit

Permalink
fixup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nrc committed Mar 19, 2018
1 parent 50c95a0 commit fa75ef4
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ use std::iter::{Enumerate, Peekable};
use std::path::{Path, PathBuf};
use std::str::Chars;

use rustfmt::*;
use rustfmt::config::{Color, Config, ReportTactic};
use rustfmt::config::summary::Summary;
use rustfmt::config::{Color, Config, ReportTactic};
use rustfmt::filemap::write_system_newlines;
use rustfmt::rustfmt_diff::*;
use rustfmt::*;

const DIFF_CONTEXT_SIZE: usize = 3;
const CONFIGURATIONS_FILE_NAME: &str = "Configurations.md";
Expand Down
1 change: 1 addition & 0 deletions tests/source/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use {/* Pre-comment! */
Foo, Bar /* comment */};
use Foo::{Bar, Baz};
pub use syntax::ast::{Expr_, Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath};

use syntax::some::{};

use self;
Expand Down
2 changes: 1 addition & 1 deletion tests/target/import-fencepost-length.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use aaaaaaaaaaaaaaa::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
use aaaaaaaaaaaaaaa::{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccccc, dddddddd};
use aaaaaaaaaaaaaaa::{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccccc,
ddddddddd};
use aaaaaaaaaaaaaaa::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
6 changes: 3 additions & 3 deletions tests/target/imports-reorder-lines-and-items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// rustfmt-reorder_imported_names: true

use std::cmp::{a, b, c, d};
use std::ddd::{a, b, c as g, d as p};
use std::ddd::aaa;
// This comment should stay with `use std::ddd:bbb;`
use std::ddd::bbb;
use std::ddd::{a, b, c as g, d as p};
/// This comment should stay with `use std::str;`
use std::str;
// This comment should stay with `use std::ddd:bbb;`
use std::ddd::bbb;
10 changes: 5 additions & 5 deletions tests/target/imports-reorder-lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

use std::cmp::{a, b, c, d};
use std::cmp::{b, e, f, g};
use std::ddd::aaa;
use std::str;
// This comment should stay with `use std::ddd;`
use std::ddd;
use std::ddd::aaa;
use std::ddd::bbb;
use std::str;

mod test {}

use aaa;
use aaa::*;
use aaa::bbb;
use aaa::*;

mod test {}
// If item names are equal, order by rename

use test::{a as aa, c};
use test::{a as bb, b};
use test::{a as aa, c};

mod test {}
// 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, c};

mod test {}
// `self` always comes first
Expand Down
4 changes: 2 additions & 2 deletions tests/target/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ use list::{// Another item

use test::{/* A */ self /* B */, Other /* C */};

use {Bar /* comment */, /* Pre-comment! */ Foo};
use Foo::{Bar, Baz};
use syntax;
pub use syntax::ast::{Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath, Expr_};
use {Bar /* comment */, /* Pre-comment! */ Foo};

use self;
use std::io;
Expand Down Expand Up @@ -54,8 +54,8 @@ use foo::{self as bar, baz};
use foo::{baz, qux as bar};

// With absolute paths
use foo;
use Foo;
use foo;
use foo::Bar;
use foo::{Bar, Baz};
use {Bar, Baz};
Expand Down
6 changes: 4 additions & 2 deletions tests/target/issue-1124.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ mod a {
use d;
}

use z;

use y;

use a;
use x;
use y;
use z;
1 change: 1 addition & 0 deletions tests/target/issue-2256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use std::borrow::Cow;

/* comment */

/* comment */

/* comment */

0 comments on commit fa75ef4

Please sign in to comment.