Update tests related to colon spacing
This commit is contained in:
parent
6a6e9a22bc
commit
15ded04f46
34 changed files with 22 additions and 240 deletions
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_after_bound_colon: false
|
||||
// Space after bound colon
|
||||
|
||||
fn lorem<T:Eq>(t:T) {
|
||||
// body
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_after_bound_colon: true
|
||||
// Space after bound colon
|
||||
|
||||
fn lorem<T:Eq>(t:T) {
|
||||
// body
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_after_struct_lit_field_colon: false
|
||||
|
||||
const LOREM: Lorem = Lorem {
|
||||
ipsum:dolor,
|
||||
sit : amet,
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_after_struct_lit_field_colon: true
|
||||
|
||||
const LOREM: Lorem = Lorem {
|
||||
ipsum:dolor,
|
||||
sit : amet,
|
||||
};
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_bound: false
|
||||
// Space before bound
|
||||
|
||||
fn lorem<T:Eq>(t:T) {
|
||||
let ipsum:Dolor = sit;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_bound: true
|
||||
// Space before bound
|
||||
|
||||
fn lorem<T:Eq>(t:T) {
|
||||
let ipsum:Dolor = sit;
|
||||
}
|
||||
11
tests/source/configs-space_before_colon-true.rs
Normal file
11
tests/source/configs-space_before_colon-true.rs
Normal 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,
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_struct_lit_field_colon: false
|
||||
|
||||
const LOREM: Lorem = Lorem {
|
||||
ipsum:dolor,
|
||||
sit : amet,
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_struct_lit_field_colon: true
|
||||
|
||||
const LOREM: Lorem = Lorem {
|
||||
ipsum:dolor,
|
||||
sit : amet,
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_type_annotation: false
|
||||
// Space before type-annotation
|
||||
|
||||
fn lorem<T:Eq>(t:T) {
|
||||
let ipsum:Dolor = sit;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_type_annotation: true
|
||||
// Space before type-annotation
|
||||
|
||||
fn lorem<T:Eq>(t:T) {
|
||||
let ipsum:Dolor = sit;
|
||||
}
|
||||
|
|
@ -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 {}
|
||||
|
|
@ -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 }
|
||||
}
|
||||
|
|
@ -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 }
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// rustfmt-space_before_bound: true
|
||||
// rustfmt-space_after_bound_colon: false
|
||||
|
||||
trait Trait {}
|
||||
fn f<'a, 'b: 'a, T: Trait>() {}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_after_bound_colon: false
|
||||
// Space after bound colon
|
||||
|
||||
fn lorem<T:Eq>(t: T) {
|
||||
// body
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_after_bound_colon: true
|
||||
// Space after bound colon
|
||||
|
||||
fn lorem<T: Eq>(t: T) {
|
||||
// body
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_after_struct_lit_field_colon: false
|
||||
|
||||
const LOREM: Lorem = Lorem {
|
||||
ipsum:dolor,
|
||||
sit:amet,
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_after_struct_lit_field_colon: true
|
||||
|
||||
const LOREM: Lorem = Lorem {
|
||||
ipsum: dolor,
|
||||
sit: amet,
|
||||
};
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_bound: false
|
||||
// Space before bound
|
||||
|
||||
fn lorem<T: Eq>(t: T) {
|
||||
let ipsum: Dolor = sit;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_bound: true
|
||||
// Space before bound
|
||||
|
||||
fn lorem<T : Eq>(t: T) {
|
||||
let ipsum: Dolor = sit;
|
||||
}
|
||||
11
tests/target/configs-space_before_colon-true.rs
Normal file
11
tests/target/configs-space_before_colon-true.rs
Normal 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,
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_struct_lit_field_colon: false
|
||||
|
||||
const LOREM: Lorem = Lorem {
|
||||
ipsum: dolor,
|
||||
sit: amet,
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_struct_lit_field_colon: true
|
||||
|
||||
const LOREM: Lorem = Lorem {
|
||||
ipsum : dolor,
|
||||
sit : amet,
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_type_annotation: false
|
||||
// Space before type-annotation
|
||||
|
||||
fn lorem<T: Eq>(t: T) {
|
||||
let ipsum: Dolor = sit;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// rustfmt-space_before_type_annotation: true
|
||||
// Space before type-annotation
|
||||
|
||||
fn lorem<T: Eq>(t : T) {
|
||||
let ipsum : Dolor = sit;
|
||||
}
|
||||
|
|
@ -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,
|
||||
{
|
||||
}
|
||||
|
|
@ -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 }
|
||||
}
|
||||
|
|
@ -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 }
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// rustfmt-space_before_bound: true
|
||||
// rustfmt-space_after_bound_colon: false
|
||||
|
||||
trait Trait {}
|
||||
fn f<'a, 'b :'a, T :Trait>() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue