Skip to content

Commit fa75ef4

Browse files
committed
fixup tests
1 parent 50c95a0 commit fa75ef4

8 files changed

+19
-15
lines changed

tests/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ use std::iter::{Enumerate, Peekable};
2323
use std::path::{Path, PathBuf};
2424
use std::str::Chars;
2525

26-
use rustfmt::*;
27-
use rustfmt::config::{Color, Config, ReportTactic};
2826
use rustfmt::config::summary::Summary;
27+
use rustfmt::config::{Color, Config, ReportTactic};
2928
use rustfmt::filemap::write_system_newlines;
3029
use rustfmt::rustfmt_diff::*;
30+
use rustfmt::*;
3131

3232
const DIFF_CONTEXT_SIZE: usize = 3;
3333
const CONFIGURATIONS_FILE_NAME: &str = "Configurations.md";

tests/source/imports.rs

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use {/* Pre-comment! */
2121
Foo, Bar /* comment */};
2222
use Foo::{Bar, Baz};
2323
pub use syntax::ast::{Expr_, Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath};
24+
2425
use syntax::some::{};
2526

2627
use self;
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1+
use aaaaaaaaaaaaaaa::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
12
use aaaaaaaaaaaaaaa::{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccccc, dddddddd};
23
use aaaaaaaaaaaaaaa::{bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccccc,
34
ddddddddd};
4-
use aaaaaaaaaaaaaaa::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

tests/target/imports-reorder-lines-and-items.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// rustfmt-reorder_imported_names: true
33

44
use std::cmp::{a, b, c, d};
5-
use std::ddd::{a, b, c as g, d as p};
65
use std::ddd::aaa;
7-
// This comment should stay with `use std::ddd:bbb;`
8-
use std::ddd::bbb;
6+
use std::ddd::{a, b, c as g, d as p};
97
/// This comment should stay with `use std::str;`
108
use std::str;
9+
// This comment should stay with `use std::ddd:bbb;`
10+
use std::ddd::bbb;

tests/target/imports-reorder-lines.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22

33
use std::cmp::{a, b, c, d};
44
use std::cmp::{b, e, f, g};
5+
use std::ddd::aaa;
6+
use std::str;
57
// This comment should stay with `use std::ddd;`
68
use std::ddd;
7-
use std::ddd::aaa;
89
use std::ddd::bbb;
9-
use std::str;
1010

1111
mod test {}
1212

1313
use aaa;
14-
use aaa::*;
1514
use aaa::bbb;
15+
use aaa::*;
1616

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

20-
use test::{a as aa, c};
2120
use test::{a as bb, b};
21+
use test::{a as aa, c};
2222

2323
mod test {}
2424
// If item names are equal, order by rename - no rename comes before a rename
2525

26-
use test::{a, c};
2726
use test::{a as bb, b};
27+
use test::{a, c};
2828

2929
mod test {}
3030
// `self` always comes first

tests/target/imports.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ use list::{// Another item
1919

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

22-
use {Bar /* comment */, /* Pre-comment! */ Foo};
2322
use Foo::{Bar, Baz};
2423
use syntax;
2524
pub use syntax::ast::{Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath, Expr_};
25+
use {Bar /* comment */, /* Pre-comment! */ Foo};
2626

2727
use self;
2828
use std::io;
@@ -54,8 +54,8 @@ use foo::{self as bar, baz};
5454
use foo::{baz, qux as bar};
5555

5656
// With absolute paths
57-
use foo;
5857
use Foo;
58+
use foo;
5959
use foo::Bar;
6060
use foo::{Bar, Baz};
6161
use {Bar, Baz};

tests/target/issue-1124.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ mod a {
1414
use d;
1515
}
1616

17+
use z;
18+
19+
use y;
20+
1721
use a;
1822
use x;
19-
use y;
20-
use z;

tests/target/issue-2256.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
use std::borrow::Cow;
33

44
/* comment */
5+
56
/* comment */
67

78
/* comment */

0 commit comments

Comments
 (0)