Update tests related to colon spacing

This commit is contained in:
topecongiro 2017-11-14 23:25:10 +09:00
parent 6a6e9a22bc
commit 15ded04f46
34 changed files with 22 additions and 240 deletions

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_bound_colon: false
// Space after bound colon
fn lorem<T:Eq>(t:T) {
// body
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_bound_colon: true
// Space after bound colon
fn lorem<T:Eq>(t:T) {
// body
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_struct_lit_field_colon: false
const LOREM: Lorem = Lorem {
ipsum:dolor,
sit : amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_struct_lit_field_colon: true
const LOREM: Lorem = Lorem {
ipsum:dolor,
sit : amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_type_annotation_colon: false
// Space after type annotation colon
fn lorem<T:Eq>(t:T) {
let ipsum:Dolor = sit;
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_type_annotation_colon: true
// Space after type annotation colon
fn lorem<T:Eq>(t:T) {
let ipsum:Dolor = sit;
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_bound: false
// Space before bound
fn lorem<T:Eq>(t:T) {
let ipsum:Dolor = sit;
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_bound: true
// Space before bound
fn lorem<T:Eq>(t:T) {
let ipsum:Dolor = sit;
}

View file

@ -0,0 +1,11 @@
// rustfmt-space_before_colon: true
// Space before colon
fn lorem<T : Eq>(t : T) {
let ipsum: Dolor = sit;
}
const LOREM : Lorem = Lorem {
ipsum : dolor,
sit : amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_struct_lit_field_colon: false
const LOREM: Lorem = Lorem {
ipsum:dolor,
sit : amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_struct_lit_field_colon: true
const LOREM: Lorem = Lorem {
ipsum:dolor,
sit : amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_type_annotation: false
// Space before type-annotation
fn lorem<T:Eq>(t:T) {
let ipsum:Dolor = sit;
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_type_annotation: true
// Space before type-annotation
fn lorem<T:Eq>(t:T) {
let ipsum:Dolor = sit;
}

View file

@ -1,10 +0,0 @@
// rustfmt-space_before_bound: true
trait Trait {}
trait Trait2 {}
fn f<'a, 'b: 'a, T: Trait, U>() where U: Trait2 {}
// should fit on the line
fn f2<'a, 'b: 'a, Ttttttttttttttttttttttttttttttttttttttttttttttt: Trait, U>() where U: Trait2 {}
// should be wrapped
fn f2<'a, 'b: 'a, Tttttttttttttttttttttttttttttttttttttttttttttttt: Trait, U>() where U: Trait2 {}

View file

@ -1,13 +0,0 @@
// rustfmt-space_before_type_annotation: true
static staticVar: i32 = 42;
const constVar: i32 = 42;
fn foo(paramVar: i32) {
let localVar: i32 = 42;
}
struct S {
fieldVar: i32,
}
fn f() {
S { fieldVar: 42 }
}

View file

@ -1,14 +0,0 @@
// rustfmt-space_before_type_annotation: true
// rustfmt-space_after_type_annotation_colon: false
static staticVar: i32 = 42;
const constVar: i32 = 42;
fn foo(paramVar: i32) {
let localVar: i32 = 42;
}
struct S {
fieldVar: i32,
}
fn f() {
S { fieldVar: 42 }
}

View file

@ -1,5 +0,0 @@
// rustfmt-space_before_bound: true
// rustfmt-space_after_bound_colon: false
trait Trait {}
fn f<'a, 'b: 'a, T: Trait>() {}

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_bound_colon: false
// Space after bound colon
fn lorem<T:Eq>(t: T) {
// body
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_bound_colon: true
// Space after bound colon
fn lorem<T: Eq>(t: T) {
// body
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_struct_lit_field_colon: false
const LOREM: Lorem = Lorem {
ipsum:dolor,
sit:amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_struct_lit_field_colon: true
const LOREM: Lorem = Lorem {
ipsum: dolor,
sit: amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_type_annotation_colon: false
// Space after type annotation colon
fn lorem<T: Eq>(t:T) {
let ipsum:Dolor = sit;
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_after_type_annotation_colon: true
// Space after type annotation colon
fn lorem<T: Eq>(t: T) {
let ipsum: Dolor = sit;
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_bound: false
// Space before bound
fn lorem<T: Eq>(t: T) {
let ipsum: Dolor = sit;
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_bound: true
// Space before bound
fn lorem<T : Eq>(t: T) {
let ipsum: Dolor = sit;
}

View file

@ -0,0 +1,11 @@
// rustfmt-space_before_colon: true
// Space before colon
fn lorem<T : Eq>(t : T) {
let ipsum : Dolor = sit;
}
const LOREM : Lorem = Lorem {
ipsum : dolor,
sit : amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_struct_lit_field_colon: false
const LOREM: Lorem = Lorem {
ipsum: dolor,
sit: amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_struct_lit_field_colon: true
const LOREM: Lorem = Lorem {
ipsum : dolor,
sit : amet,
};

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_type_annotation: false
// Space before type-annotation
fn lorem<T: Eq>(t: T) {
let ipsum: Dolor = sit;
}

View file

@ -1,6 +0,0 @@
// rustfmt-space_before_type_annotation: true
// Space before type-annotation
fn lorem<T: Eq>(t : T) {
let ipsum : Dolor = sit;
}

View file

@ -1,22 +0,0 @@
// rustfmt-space_before_bound: true
trait Trait {}
trait Trait2 {}
fn f<'a, 'b : 'a, T : Trait, U>()
where
U : Trait2,
{
}
// should fit on the line
fn f2<'a, 'b : 'a, Ttttttttttttttttttttttttttttttttttttttttttttttt : Trait, U>()
where
U : Trait2,
{
}
// should be wrapped
fn f2<'a, 'b : 'a, Tttttttttttttttttttttttttttttttttttttttttttttttt : Trait, U>()
where
U : Trait2,
{
}

View file

@ -1,13 +0,0 @@
// rustfmt-space_before_type_annotation: true
static staticVar : i32 = 42;
const constVar : i32 = 42;
fn foo(paramVar : i32) {
let localVar : i32 = 42;
}
struct S {
fieldVar : i32,
}
fn f() {
S { fieldVar: 42 }
}

View file

@ -1,14 +0,0 @@
// rustfmt-space_before_type_annotation: true
// rustfmt-space_after_type_annotation_colon: false
static staticVar :i32 = 42;
const constVar :i32 = 42;
fn foo(paramVar :i32) {
let localVar :i32 = 42;
}
struct S {
fieldVar :i32,
}
fn f() {
S { fieldVar: 42 }
}

View file

@ -1,5 +0,0 @@
// rustfmt-space_before_bound: true
// rustfmt-space_after_bound_colon: false
trait Trait {}
fn f<'a, 'b :'a, T :Trait>() {}