From 15ded04f46eef3a19cb2e843c6c084e63a2af009 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Tue, 14 Nov 2017 23:25:10 +0900 Subject: [PATCH] Update tests related to colon spacing --- .../configs-space_after_bound_colon-false.rs | 6 ----- .../configs-space_after_bound_colon-true.rs | 6 ----- ...pace_after_struct_lit_field_colon-false.rs | 6 ----- ...space_after_struct_lit_field_colon-true.rs | 6 ----- ...space_after_type_annotation_colon-false.rs | 6 ----- ...-space_after_type_annotation_colon-true.rs | 6 ----- .../configs-space_before_bound-false.rs | 6 ----- .../source/configs-space_before_bound-true.rs | 6 ----- .../source/configs-space_before_colon-true.rs | 11 ++++++++++ ...ace_before_struct_lit_field_colon-false.rs | 6 ----- ...pace_before_struct_lit_field_colon-true.rs | 6 ----- ...figs-space_before_type_annotation-false.rs | 6 ----- ...nfigs-space_before_type_annotation-true.rs | 6 ----- tests/source/space-before-bound.rs | 10 --------- tests/source/space-before-type-annotation.rs | 13 ----------- .../space-not-after-type-annotation-colon.rs | 14 ------------ tests/source/space-not-before-bound-colon.rs | 5 ----- .../configs-space_after_bound_colon-false.rs | 6 ----- .../configs-space_after_bound_colon-true.rs | 6 ----- ...pace_after_struct_lit_field_colon-false.rs | 6 ----- ...space_after_struct_lit_field_colon-true.rs | 6 ----- ...space_after_type_annotation_colon-false.rs | 6 ----- ...-space_after_type_annotation_colon-true.rs | 6 ----- .../configs-space_before_bound-false.rs | 6 ----- .../target/configs-space_before_bound-true.rs | 6 ----- .../target/configs-space_before_colon-true.rs | 11 ++++++++++ ...ace_before_struct_lit_field_colon-false.rs | 6 ----- ...pace_before_struct_lit_field_colon-true.rs | 6 ----- ...figs-space_before_type_annotation-false.rs | 6 ----- ...nfigs-space_before_type_annotation-true.rs | 6 ----- tests/target/space-before-bound.rs | 22 ------------------- tests/target/space-before-type-annotation.rs | 13 ----------- .../space-not-after-type-annotation-colon.rs | 14 ------------ tests/target/space-not-before-bound-colon.rs | 5 ----- 34 files changed, 22 insertions(+), 240 deletions(-) delete mode 100644 tests/source/configs-space_after_bound_colon-false.rs delete mode 100644 tests/source/configs-space_after_bound_colon-true.rs delete mode 100644 tests/source/configs-space_after_struct_lit_field_colon-false.rs delete mode 100644 tests/source/configs-space_after_struct_lit_field_colon-true.rs delete mode 100644 tests/source/configs-space_after_type_annotation_colon-false.rs delete mode 100644 tests/source/configs-space_after_type_annotation_colon-true.rs delete mode 100644 tests/source/configs-space_before_bound-false.rs delete mode 100644 tests/source/configs-space_before_bound-true.rs create mode 100644 tests/source/configs-space_before_colon-true.rs delete mode 100644 tests/source/configs-space_before_struct_lit_field_colon-false.rs delete mode 100644 tests/source/configs-space_before_struct_lit_field_colon-true.rs delete mode 100644 tests/source/configs-space_before_type_annotation-false.rs delete mode 100644 tests/source/configs-space_before_type_annotation-true.rs delete mode 100644 tests/source/space-before-bound.rs delete mode 100644 tests/source/space-before-type-annotation.rs delete mode 100644 tests/source/space-not-after-type-annotation-colon.rs delete mode 100644 tests/source/space-not-before-bound-colon.rs delete mode 100644 tests/target/configs-space_after_bound_colon-false.rs delete mode 100644 tests/target/configs-space_after_bound_colon-true.rs delete mode 100644 tests/target/configs-space_after_struct_lit_field_colon-false.rs delete mode 100644 tests/target/configs-space_after_struct_lit_field_colon-true.rs delete mode 100644 tests/target/configs-space_after_type_annotation_colon-false.rs delete mode 100644 tests/target/configs-space_after_type_annotation_colon-true.rs delete mode 100644 tests/target/configs-space_before_bound-false.rs delete mode 100644 tests/target/configs-space_before_bound-true.rs create mode 100644 tests/target/configs-space_before_colon-true.rs delete mode 100644 tests/target/configs-space_before_struct_lit_field_colon-false.rs delete mode 100644 tests/target/configs-space_before_struct_lit_field_colon-true.rs delete mode 100644 tests/target/configs-space_before_type_annotation-false.rs delete mode 100644 tests/target/configs-space_before_type_annotation-true.rs delete mode 100644 tests/target/space-before-bound.rs delete mode 100644 tests/target/space-before-type-annotation.rs delete mode 100644 tests/target/space-not-after-type-annotation-colon.rs delete mode 100644 tests/target/space-not-before-bound-colon.rs diff --git a/tests/source/configs-space_after_bound_colon-false.rs b/tests/source/configs-space_after_bound_colon-false.rs deleted file mode 100644 index 129d51048cca..000000000000 --- a/tests/source/configs-space_after_bound_colon-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_bound_colon: false -// Space after bound colon - -fn lorem(t:T) { - // body -} diff --git a/tests/source/configs-space_after_bound_colon-true.rs b/tests/source/configs-space_after_bound_colon-true.rs deleted file mode 100644 index 32ebd52b1028..000000000000 --- a/tests/source/configs-space_after_bound_colon-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_bound_colon: true -// Space after bound colon - -fn lorem(t:T) { - // body -} diff --git a/tests/source/configs-space_after_struct_lit_field_colon-false.rs b/tests/source/configs-space_after_struct_lit_field_colon-false.rs deleted file mode 100644 index 3ee99fa5d1d8..000000000000 --- a/tests/source/configs-space_after_struct_lit_field_colon-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_struct_lit_field_colon: false - -const LOREM: Lorem = Lorem { - ipsum:dolor, - sit : amet, -}; diff --git a/tests/source/configs-space_after_struct_lit_field_colon-true.rs b/tests/source/configs-space_after_struct_lit_field_colon-true.rs deleted file mode 100644 index 6105d4725d8a..000000000000 --- a/tests/source/configs-space_after_struct_lit_field_colon-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_struct_lit_field_colon: true - -const LOREM: Lorem = Lorem { - ipsum:dolor, - sit : amet, -}; diff --git a/tests/source/configs-space_after_type_annotation_colon-false.rs b/tests/source/configs-space_after_type_annotation_colon-false.rs deleted file mode 100644 index f814593a94e8..000000000000 --- a/tests/source/configs-space_after_type_annotation_colon-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_type_annotation_colon: false -// Space after type annotation colon - -fn lorem(t:T) { - let ipsum:Dolor = sit; -} diff --git a/tests/source/configs-space_after_type_annotation_colon-true.rs b/tests/source/configs-space_after_type_annotation_colon-true.rs deleted file mode 100644 index 1a86a5879bdb..000000000000 --- a/tests/source/configs-space_after_type_annotation_colon-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_type_annotation_colon: true -// Space after type annotation colon - -fn lorem(t:T) { - let ipsum:Dolor = sit; -} diff --git a/tests/source/configs-space_before_bound-false.rs b/tests/source/configs-space_before_bound-false.rs deleted file mode 100644 index f6168281c4fd..000000000000 --- a/tests/source/configs-space_before_bound-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_bound: false -// Space before bound - -fn lorem(t:T) { - let ipsum:Dolor = sit; -} diff --git a/tests/source/configs-space_before_bound-true.rs b/tests/source/configs-space_before_bound-true.rs deleted file mode 100644 index 7a16b5dbca3a..000000000000 --- a/tests/source/configs-space_before_bound-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_bound: true -// Space before bound - -fn lorem(t:T) { - let ipsum:Dolor = sit; -} diff --git a/tests/source/configs-space_before_colon-true.rs b/tests/source/configs-space_before_colon-true.rs new file mode 100644 index 000000000000..0a597602528a --- /dev/null +++ b/tests/source/configs-space_before_colon-true.rs @@ -0,0 +1,11 @@ +// rustfmt-space_before_colon: true +// Space before colon + +fn lorem(t : T) { + let ipsum: Dolor = sit; +} + +const LOREM : Lorem = Lorem { + ipsum : dolor, + sit : amet, +}; diff --git a/tests/source/configs-space_before_struct_lit_field_colon-false.rs b/tests/source/configs-space_before_struct_lit_field_colon-false.rs deleted file mode 100644 index a2d71c8bf0bc..000000000000 --- a/tests/source/configs-space_before_struct_lit_field_colon-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_struct_lit_field_colon: false - -const LOREM: Lorem = Lorem { - ipsum:dolor, - sit : amet, -}; diff --git a/tests/source/configs-space_before_struct_lit_field_colon-true.rs b/tests/source/configs-space_before_struct_lit_field_colon-true.rs deleted file mode 100644 index 50e4ba12d82b..000000000000 --- a/tests/source/configs-space_before_struct_lit_field_colon-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_struct_lit_field_colon: true - -const LOREM: Lorem = Lorem { - ipsum:dolor, - sit : amet, -}; diff --git a/tests/source/configs-space_before_type_annotation-false.rs b/tests/source/configs-space_before_type_annotation-false.rs deleted file mode 100644 index 817aa5c59408..000000000000 --- a/tests/source/configs-space_before_type_annotation-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_type_annotation: false -// Space before type-annotation - -fn lorem(t:T) { - let ipsum:Dolor = sit; -} diff --git a/tests/source/configs-space_before_type_annotation-true.rs b/tests/source/configs-space_before_type_annotation-true.rs deleted file mode 100644 index 4df9ad341e69..000000000000 --- a/tests/source/configs-space_before_type_annotation-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_type_annotation: true -// Space before type-annotation - -fn lorem(t:T) { - let ipsum:Dolor = sit; -} diff --git a/tests/source/space-before-bound.rs b/tests/source/space-before-bound.rs deleted file mode 100644 index 2a77eb2d2f92..000000000000 --- a/tests/source/space-before-bound.rs +++ /dev/null @@ -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 {} diff --git a/tests/source/space-before-type-annotation.rs b/tests/source/space-before-type-annotation.rs deleted file mode 100644 index 15a75e4cf33b..000000000000 --- a/tests/source/space-before-type-annotation.rs +++ /dev/null @@ -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 } -} diff --git a/tests/source/space-not-after-type-annotation-colon.rs b/tests/source/space-not-after-type-annotation-colon.rs deleted file mode 100644 index 86f829c83538..000000000000 --- a/tests/source/space-not-after-type-annotation-colon.rs +++ /dev/null @@ -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 } -} diff --git a/tests/source/space-not-before-bound-colon.rs b/tests/source/space-not-before-bound-colon.rs deleted file mode 100644 index 4ec569f7902f..000000000000 --- a/tests/source/space-not-before-bound-colon.rs +++ /dev/null @@ -1,5 +0,0 @@ -// rustfmt-space_before_bound: true -// rustfmt-space_after_bound_colon: false - -trait Trait {} -fn f<'a, 'b: 'a, T: Trait>() {} diff --git a/tests/target/configs-space_after_bound_colon-false.rs b/tests/target/configs-space_after_bound_colon-false.rs deleted file mode 100644 index d254246b0f07..000000000000 --- a/tests/target/configs-space_after_bound_colon-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_bound_colon: false -// Space after bound colon - -fn lorem(t: T) { - // body -} diff --git a/tests/target/configs-space_after_bound_colon-true.rs b/tests/target/configs-space_after_bound_colon-true.rs deleted file mode 100644 index 301b07dfa82a..000000000000 --- a/tests/target/configs-space_after_bound_colon-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_bound_colon: true -// Space after bound colon - -fn lorem(t: T) { - // body -} diff --git a/tests/target/configs-space_after_struct_lit_field_colon-false.rs b/tests/target/configs-space_after_struct_lit_field_colon-false.rs deleted file mode 100644 index 8f4750594646..000000000000 --- a/tests/target/configs-space_after_struct_lit_field_colon-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_struct_lit_field_colon: false - -const LOREM: Lorem = Lorem { - ipsum:dolor, - sit:amet, -}; diff --git a/tests/target/configs-space_after_struct_lit_field_colon-true.rs b/tests/target/configs-space_after_struct_lit_field_colon-true.rs deleted file mode 100644 index 34fb792dcb55..000000000000 --- a/tests/target/configs-space_after_struct_lit_field_colon-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_struct_lit_field_colon: true - -const LOREM: Lorem = Lorem { - ipsum: dolor, - sit: amet, -}; diff --git a/tests/target/configs-space_after_type_annotation_colon-false.rs b/tests/target/configs-space_after_type_annotation_colon-false.rs deleted file mode 100644 index d27a5af37615..000000000000 --- a/tests/target/configs-space_after_type_annotation_colon-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_type_annotation_colon: false -// Space after type annotation colon - -fn lorem(t:T) { - let ipsum:Dolor = sit; -} diff --git a/tests/target/configs-space_after_type_annotation_colon-true.rs b/tests/target/configs-space_after_type_annotation_colon-true.rs deleted file mode 100644 index ba0da25f836a..000000000000 --- a/tests/target/configs-space_after_type_annotation_colon-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_after_type_annotation_colon: true -// Space after type annotation colon - -fn lorem(t: T) { - let ipsum: Dolor = sit; -} diff --git a/tests/target/configs-space_before_bound-false.rs b/tests/target/configs-space_before_bound-false.rs deleted file mode 100644 index 16e14bb77e3d..000000000000 --- a/tests/target/configs-space_before_bound-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_bound: false -// Space before bound - -fn lorem(t: T) { - let ipsum: Dolor = sit; -} diff --git a/tests/target/configs-space_before_bound-true.rs b/tests/target/configs-space_before_bound-true.rs deleted file mode 100644 index 3ee3dffb20ac..000000000000 --- a/tests/target/configs-space_before_bound-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_bound: true -// Space before bound - -fn lorem(t: T) { - let ipsum: Dolor = sit; -} diff --git a/tests/target/configs-space_before_colon-true.rs b/tests/target/configs-space_before_colon-true.rs new file mode 100644 index 000000000000..e2895b5d77b1 --- /dev/null +++ b/tests/target/configs-space_before_colon-true.rs @@ -0,0 +1,11 @@ +// rustfmt-space_before_colon: true +// Space before colon + +fn lorem(t : T) { + let ipsum : Dolor = sit; +} + +const LOREM : Lorem = Lorem { + ipsum : dolor, + sit : amet, +}; diff --git a/tests/target/configs-space_before_struct_lit_field_colon-false.rs b/tests/target/configs-space_before_struct_lit_field_colon-false.rs deleted file mode 100644 index 48336954786b..000000000000 --- a/tests/target/configs-space_before_struct_lit_field_colon-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_struct_lit_field_colon: false - -const LOREM: Lorem = Lorem { - ipsum: dolor, - sit: amet, -}; diff --git a/tests/target/configs-space_before_struct_lit_field_colon-true.rs b/tests/target/configs-space_before_struct_lit_field_colon-true.rs deleted file mode 100644 index e4f1cdb4575f..000000000000 --- a/tests/target/configs-space_before_struct_lit_field_colon-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_struct_lit_field_colon: true - -const LOREM: Lorem = Lorem { - ipsum : dolor, - sit : amet, -}; diff --git a/tests/target/configs-space_before_type_annotation-false.rs b/tests/target/configs-space_before_type_annotation-false.rs deleted file mode 100644 index b75144f7ca66..000000000000 --- a/tests/target/configs-space_before_type_annotation-false.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_type_annotation: false -// Space before type-annotation - -fn lorem(t: T) { - let ipsum: Dolor = sit; -} diff --git a/tests/target/configs-space_before_type_annotation-true.rs b/tests/target/configs-space_before_type_annotation-true.rs deleted file mode 100644 index 355cf9f5db9a..000000000000 --- a/tests/target/configs-space_before_type_annotation-true.rs +++ /dev/null @@ -1,6 +0,0 @@ -// rustfmt-space_before_type_annotation: true -// Space before type-annotation - -fn lorem(t : T) { - let ipsum : Dolor = sit; -} diff --git a/tests/target/space-before-bound.rs b/tests/target/space-before-bound.rs deleted file mode 100644 index 538d0d41a5e7..000000000000 --- a/tests/target/space-before-bound.rs +++ /dev/null @@ -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, -{ -} diff --git a/tests/target/space-before-type-annotation.rs b/tests/target/space-before-type-annotation.rs deleted file mode 100644 index 0ad06dbb70c3..000000000000 --- a/tests/target/space-before-type-annotation.rs +++ /dev/null @@ -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 } -} diff --git a/tests/target/space-not-after-type-annotation-colon.rs b/tests/target/space-not-after-type-annotation-colon.rs deleted file mode 100644 index b07620fb4c17..000000000000 --- a/tests/target/space-not-after-type-annotation-colon.rs +++ /dev/null @@ -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 } -} diff --git a/tests/target/space-not-before-bound-colon.rs b/tests/target/space-not-before-bound-colon.rs deleted file mode 100644 index ef48eca11149..000000000000 --- a/tests/target/space-not-before-bound-colon.rs +++ /dev/null @@ -1,5 +0,0 @@ -// rustfmt-space_before_bound: true -// rustfmt-space_after_bound_colon: false - -trait Trait {} -fn f<'a, 'b :'a, T :Trait>() {}