Add and improve tests of file_lines

This commit is contained in:
Jonathan Behrens 2017-05-13 13:15:17 -04:00
parent 9f83f29187
commit 4d2f6a29a7
No known key found for this signature in database
GPG Key ID: 91499BA7543B1F47
6 changed files with 76 additions and 6 deletions

View File

@ -11,10 +11,10 @@ fn floaters() {
let y = if cond {
val1
} else {
val2
val2
}
.method_call();
// aaaaaaaaaaaaa
{
match x {
PushParam => {
@ -24,6 +24,6 @@ fn floaters() {
}]
.clone());
}
}
}
}
}

View File

@ -0,0 +1,17 @@
// rustfmt-file_lines: [{"file":"tests/source/file-lines-5.rs","range":[3,5]}]
struct A {
t: i64,
}
mod foo {
fn bar() {
// test
let i = 12;
// test
}
// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
fn baz() {
let j = 15;
}
}

View File

@ -0,0 +1,18 @@
// rustfmt-file_lines: [{"file":"tests/source/file-lines-6.rs","range":[9,10]}]
struct A {
t: i64,
}
mod foo {
fn bar() {
// test
let i = 12;
// test
}
fn baz() {
///
let j = 15;
}
}

View File

@ -11,10 +11,10 @@ fn floaters() {
let y = if cond {
val1
} else {
val2
val2
}
.method_call();
// aaaaaaaaaaaaa
{
match x {
PushParam => {
@ -24,6 +24,6 @@ fn floaters() {
}]
.clone());
}
}
}
}
}

View File

@ -0,0 +1,17 @@
// rustfmt-file_lines: [{"file":"tests/source/file-lines-5.rs","range":[3,5]}]
struct A {
t: i64,
}
mod foo {
fn bar() {
// test
let i = 12;
// test
}
// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
fn baz() {
let j = 15;
}
}

View File

@ -0,0 +1,18 @@
// rustfmt-file_lines: [{"file":"tests/source/file-lines-6.rs","range":[9,10]}]
struct A {
t: i64,
}
mod foo {
fn bar() {
// test
let i = 12;
// test
}
fn baz() {
///
let j = 15;
}
}