]> git.lizzy.rs Git - rust.git/commitdiff
Update tests related to spaces with parens and brackets
authortopecongiro <seuchida@gmail.com>
Tue, 14 Nov 2017 14:37:27 +0000 (23:37 +0900)
committertopecongiro <seuchida@gmail.com>
Tue, 14 Nov 2017 14:37:27 +0000 (23:37 +0900)
22 files changed:
tests/source/configs-spaces_within_angle_brackets-false.rs [deleted file]
tests/source/configs-spaces_within_angle_brackets-true.rs [deleted file]
tests/source/configs-spaces_within_parens-false.rs [deleted file]
tests/source/configs-spaces_within_parens-true.rs [deleted file]
tests/source/configs-spaces_within_parens_and_brackets-false.rs [new file with mode: 0644]
tests/source/configs-spaces_within_parens_and_brackets-true.rs [new file with mode: 0644]
tests/source/configs-spaces_within_square_brackets-false.rs [deleted file]
tests/source/configs-spaces_within_square_brackets-true.rs [deleted file]
tests/source/spaces-within-angle-brackets.rs [deleted file]
tests/source/spaces-within-parens.rs [deleted file]
tests/source/spaces-within-square-brackets.rs [deleted file]
tests/target/configs-spaces_within_angle_brackets-false.rs [deleted file]
tests/target/configs-spaces_within_angle_brackets-true.rs [deleted file]
tests/target/configs-spaces_within_parens-false.rs [deleted file]
tests/target/configs-spaces_within_parens-true.rs [deleted file]
tests/target/configs-spaces_within_parens_and_brackets-false.rs [new file with mode: 0644]
tests/target/configs-spaces_within_parens_and_brackets-true.rs [new file with mode: 0644]
tests/target/configs-spaces_within_square_brackets-false.rs [deleted file]
tests/target/configs-spaces_within_square_brackets-true.rs [deleted file]
tests/target/spaces-within-angle-brackets.rs [deleted file]
tests/target/spaces-within-parens.rs [deleted file]
tests/target/spaces-within-square-brackets.rs [deleted file]

diff --git a/tests/source/configs-spaces_within_angle_brackets-false.rs b/tests/source/configs-spaces_within_angle_brackets-false.rs
deleted file mode 100644 (file)
index 3823216..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_angle_brackets: false
-// Spaces within angle-brackets
-
-fn lorem<T: Eq>(t: T) {
-    // body
-}
diff --git a/tests/source/configs-spaces_within_angle_brackets-true.rs b/tests/source/configs-spaces_within_angle_brackets-true.rs
deleted file mode 100644 (file)
index f2b97d7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_angle_brackets: true
-// Spaces within angle-brackets
-
-fn lorem<T: Eq>(t: T) {
-    // body
-}
diff --git a/tests/source/configs-spaces_within_parens-false.rs b/tests/source/configs-spaces_within_parens-false.rs
deleted file mode 100644 (file)
index 05c2558..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_parens: false
-// Spaces within parens
-
-fn lorem<T: Eq>(t: T) {
-    let lorem = (ipsum, dolor);
-}
diff --git a/tests/source/configs-spaces_within_parens-true.rs b/tests/source/configs-spaces_within_parens-true.rs
deleted file mode 100644 (file)
index 7f041d7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_parens: true
-// Spaces within parens
-
-fn lorem<T: Eq>(t: T) {
-    let lorem = (ipsum, dolor);
-}
diff --git a/tests/source/configs-spaces_within_parens_and_brackets-false.rs b/tests/source/configs-spaces_within_parens_and_brackets-false.rs
new file mode 100644 (file)
index 0000000..908373c
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-spaces_within_parens_and_brackets: false
+// Spaces within parens and brackets
+
+fn lorem<T: Eq>(t: T) {
+    let lorem = (ipsum, dolor);
+    let lorem: [usize; 2] = [ipsum, dolor];
+}
diff --git a/tests/source/configs-spaces_within_parens_and_brackets-true.rs b/tests/source/configs-spaces_within_parens_and_brackets-true.rs
new file mode 100644 (file)
index 0000000..2e3c92d
--- /dev/null
@@ -0,0 +1,133 @@
+// rustfmt-spaces_within_parens_and_brackets: true
+// Spaces within parens and brackets
+
+fn lorem<T: Eq>(t: T) {
+    let lorem = (ipsum, dolor);
+    let lorem: [usize; 2] = [ipsum, dolor];
+}
+
+enum E {
+    A(u32),
+    B(u32, u32),
+    C(u32, u32, u32),
+    D(),
+}
+
+struct TupleStruct0();
+struct TupleStruct1(u32);
+struct TupleStruct2(u32, u32);
+
+fn fooEmpty() {}
+
+fn foo(e: E, _: u32) -> (u32, u32) {
+    // Tuples
+    let t1 = ();
+    let t2 = (1,);
+    let t3 = (1, 2);
+
+    let ts0 = TupleStruct0();
+    let ts1 = TupleStruct1(1);
+    let ts2 = TupleStruct2(1, 2);
+
+    // Tuple pattern
+    let (a,b,c) = (1,2,3);
+
+    // Expressions
+    let x = (1 + 2) * (3);
+
+    // Function call
+    fooEmpty();
+    foo(1, 2);
+
+    // Pattern matching
+    match e {
+        A(_) => (),
+        B(_, _) => (),
+        C(..) => (),
+        D => (),
+    }
+
+    (1,2)
+}
+
+struct Foo<T> {
+    i: T,
+}
+
+struct Bar<T, E> {
+    i: T,
+    e: E,
+}
+
+struct Foo<'a> {
+    i: &'a str,
+}
+
+enum E<T> {
+    T(T),
+}
+
+enum E<T, S> {
+    T(T),
+    S(S),
+}
+
+fn foo<T>(a: T) {
+    foo::<u32>(10);
+}
+
+fn foo<T, E>(a: T, b: E) {
+    foo::<u32, str>(10, "bar");
+}
+
+fn foo<T: Send, E: Send>(a: T, b: E) {
+    foo::<u32, str>(10, "bar");
+
+    let opt: Option<u32>;
+    let res: Result<u32, String>;
+}
+
+fn foo<'a>(a: &'a str) {
+    foo("foo");
+}
+
+fn foo<'a, 'b>(a: &'a str, b: &'b str) {
+    foo("foo", "bar");
+}
+
+impl Foo {
+    fn bar() {
+        <Foo as Foo>::bar();
+    }
+}
+
+trait MyTrait<A, D> {}
+impl<A: Send, D: Send> MyTrait<A, D> for Foo {}
+
+fn foo() where for<'a> u32: 'a {}
+
+fn main() {
+    let arr: [i32; 5] = [1, 2, 3, 4, 5];
+    let arr: [i32; 500] = [0; 500];
+
+    let v = vec![1, 2, 3];
+    assert_eq!(arr, [1, 2, 3]);
+
+    let i = arr[0];
+
+    let slice = &arr[1..2];
+
+    let line100_________________________________________________________________________ = [1, 2];
+    let line101__________________________________________________________________________ = [1, 2];
+    let line102___________________________________________________________________________ = [1, 2];
+    let line103____________________________________________________________________________ = [1, 2];
+    let line104_____________________________________________________________________________ = [1, 2];
+
+    let line100_____________________________________________________________________ = vec![1, 2];
+    let line101______________________________________________________________________ = vec![1, 2];
+    let line102_______________________________________________________________________ = vec![1, 2];
+    let line103________________________________________________________________________ = vec![1, 2];
+    let line104_________________________________________________________________________ = vec![1, 2];
+}
+
+fn f(slice: &[i32]) {}
diff --git a/tests/source/configs-spaces_within_square_brackets-false.rs b/tests/source/configs-spaces_within_square_brackets-false.rs
deleted file mode 100644 (file)
index 6410646..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_square_brackets: false
-// Spaces within square-brackets
-
-fn main() {
-    let lorem: [usize; 2] = [ipsum, dolor];
-}
diff --git a/tests/source/configs-spaces_within_square_brackets-true.rs b/tests/source/configs-spaces_within_square_brackets-true.rs
deleted file mode 100644 (file)
index 8683fb5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_square_brackets: true
-// Spaces within square-brackets
-
-fn main() {
-    let lorem: [usize; 2] = [ipsum, dolor];
-}
diff --git a/tests/source/spaces-within-angle-brackets.rs b/tests/source/spaces-within-angle-brackets.rs
deleted file mode 100644 (file)
index 73cab84..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// rustfmt-spaces_within_angle_brackets: true
-
-struct Foo<T> {
-    i: T,
-}
-
-struct Bar<T, E> {
-    i: T,
-    e: E,
-}
-
-struct Foo<'a> {
-    i: &'a str,
-}
-
-enum E<T> {
-    T(T),
-}
-
-enum E<T, S> {
-    T(T),
-    S(S),
-}
-
-fn foo<T>(a: T) {
-    foo::<u32>(10);
-}
-
-fn foo<T, E>(a: T, b: E) {
-    foo::<u32, str>(10, "bar");
-}
-
-fn foo<T: Send, E: Send>(a: T, b: E) {
-    foo::<u32, str>(10, "bar");
-
-    let opt: Option<u32>;
-    let res: Result<u32, String>;
-}
-
-fn foo<'a>(a: &'a str) {
-    foo("foo");
-}
-
-fn foo<'a, 'b>(a: &'a str, b: &'b str) {
-    foo("foo", "bar");
-}
-
-impl Foo {
-    fn bar() {
-        <Foo as Foo>::bar();
-    }
-}
-
-trait MyTrait<A, D> {}
-impl<A: Send, D: Send> MyTrait<A, D> for Foo {}
-
-fn foo() where for<'a> u32: 'a {}
diff --git a/tests/source/spaces-within-parens.rs b/tests/source/spaces-within-parens.rs
deleted file mode 100644 (file)
index dba8d7c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// rustfmt-spaces_within_parens: true
-
-enum E {
-    A(u32),
-    B(u32, u32),
-    C(u32, u32, u32),
-    D(),
-}
-
-struct TupleStruct0();
-struct TupleStruct1(u32);
-struct TupleStruct2(u32, u32);
-
-fn fooEmpty() {}
-
-fn foo(e: E, _: u32) -> (u32, u32) {
-    // Tuples
-    let t1 = ();
-    let t2 = (1,);
-    let t3 = (1, 2);
-
-    let ts0 = TupleStruct0();
-    let ts1 = TupleStruct1(1);
-    let ts2 = TupleStruct2(1, 2);
-
-    // Tuple pattern
-    let (a,b,c) = (1,2,3);
-
-    // Expressions
-    let x = (1 + 2) * (3);
-
-    // Function call
-    fooEmpty();
-    foo(1, 2);
-
-    // Pattern matching
-    match e {
-        A(_) => (),
-        B(_, _) => (),
-        C(..) => (),
-        D => (),
-    }
-
-    (1,2)
-}
diff --git a/tests/source/spaces-within-square-brackets.rs b/tests/source/spaces-within-square-brackets.rs
deleted file mode 100644 (file)
index d0466ca..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// rustfmt-spaces_within_square_brackets: true
-
-fn main() {
-    let arr: [i32; 5] = [1, 2, 3, 4, 5];
-    let arr: [i32; 500] = [0; 500];
-
-    let v = vec![1, 2, 3];
-    assert_eq!(arr, [1, 2, 3]);
-
-    let i = arr[0];
-
-    let slice = &arr[1..2];
-
-    let line100_________________________________________________________________________ = [1, 2];
-    let line101__________________________________________________________________________ = [1, 2];
-    let line102___________________________________________________________________________ = [1, 2];
-    let line103____________________________________________________________________________ = [1, 2];
-    let line104_____________________________________________________________________________ = [1, 2];
-
-    let line100_____________________________________________________________________ = vec![1, 2];
-    let line101______________________________________________________________________ = vec![1, 2];
-    let line102_______________________________________________________________________ = vec![1, 2];
-    let line103________________________________________________________________________ = vec![1, 2];
-    let line104_________________________________________________________________________ = vec![1, 2];
-}
-
-fn f(slice: &[i32]) {}
diff --git a/tests/target/configs-spaces_within_angle_brackets-false.rs b/tests/target/configs-spaces_within_angle_brackets-false.rs
deleted file mode 100644 (file)
index 3823216..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_angle_brackets: false
-// Spaces within angle-brackets
-
-fn lorem<T: Eq>(t: T) {
-    // body
-}
diff --git a/tests/target/configs-spaces_within_angle_brackets-true.rs b/tests/target/configs-spaces_within_angle_brackets-true.rs
deleted file mode 100644 (file)
index fef5ac2..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_angle_brackets: true
-// Spaces within angle-brackets
-
-fn lorem< T: Eq >(t: T) {
-    // body
-}
diff --git a/tests/target/configs-spaces_within_parens-false.rs b/tests/target/configs-spaces_within_parens-false.rs
deleted file mode 100644 (file)
index 05c2558..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_parens: false
-// Spaces within parens
-
-fn lorem<T: Eq>(t: T) {
-    let lorem = (ipsum, dolor);
-}
diff --git a/tests/target/configs-spaces_within_parens-true.rs b/tests/target/configs-spaces_within_parens-true.rs
deleted file mode 100644 (file)
index 2461afb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_parens: true
-// Spaces within parens
-
-fn lorem<T: Eq>( t: T ) {
-    let lorem = ( ipsum, dolor );
-}
diff --git a/tests/target/configs-spaces_within_parens_and_brackets-false.rs b/tests/target/configs-spaces_within_parens_and_brackets-false.rs
new file mode 100644 (file)
index 0000000..908373c
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-spaces_within_parens_and_brackets: false
+// Spaces within parens and brackets
+
+fn lorem<T: Eq>(t: T) {
+    let lorem = (ipsum, dolor);
+    let lorem: [usize; 2] = [ipsum, dolor];
+}
diff --git a/tests/target/configs-spaces_within_parens_and_brackets-true.rs b/tests/target/configs-spaces_within_parens_and_brackets-true.rs
new file mode 100644 (file)
index 0000000..343b874
--- /dev/null
@@ -0,0 +1,145 @@
+// rustfmt-spaces_within_parens_and_brackets: true
+// Spaces within parens and brackets
+
+fn lorem< T: Eq >( t: T ) {
+    let lorem = ( ipsum, dolor );
+    let lorem: [ usize; 2 ] = [ ipsum, dolor ];
+}
+
+enum E {
+    A( u32 ),
+    B( u32, u32 ),
+    C( u32, u32, u32 ),
+    D(),
+}
+
+struct TupleStruct0();
+struct TupleStruct1( u32 );
+struct TupleStruct2( u32, u32 );
+
+fn fooEmpty() {}
+
+fn foo( e: E, _: u32 ) -> ( u32, u32 ) {
+    // Tuples
+    let t1 = ();
+    let t2 = ( 1, );
+    let t3 = ( 1, 2 );
+
+    let ts0 = TupleStruct0();
+    let ts1 = TupleStruct1( 1 );
+    let ts2 = TupleStruct2( 1, 2 );
+
+    // Tuple pattern
+    let ( a, b, c ) = ( 1, 2, 3 );
+
+    // Expressions
+    let x = ( 1 + 2 ) * ( 3 );
+
+    // Function call
+    fooEmpty();
+    foo( 1, 2 );
+
+    // Pattern matching
+    match e {
+        A( _ ) => (),
+        B( _, _ ) => (),
+        C( .. ) => (),
+        D => (),
+    }
+
+    ( 1, 2 )
+}
+
+struct Foo< T > {
+    i: T,
+}
+
+struct Bar< T, E > {
+    i: T,
+    e: E,
+}
+
+struct Foo< 'a > {
+    i: &'a str,
+}
+
+enum E< T > {
+    T(T),
+}
+
+enum E< T, S > {
+    T(T),
+    S(S),
+}
+
+fn foo< T >(a: T) {
+    foo::< u32 >(10);
+}
+
+fn foo< T, E >(a: T, b: E) {
+    foo::< u32, str >(10, "bar");
+}
+
+fn foo< T: Send, E: Send >(a: T, b: E) {
+    foo::< u32, str >(10, "bar");
+
+    let opt: Option< u32 >;
+    let res: Result< u32, String >;
+}
+
+fn foo< 'a >(a: &'a str) {
+    foo("foo");
+}
+
+fn foo< 'a, 'b >(a: &'a str, b: &'b str) {
+    foo("foo", "bar");
+}
+
+impl Foo {
+    fn bar() {
+        < Foo as Foo >::bar();
+    }
+}
+
+trait MyTrait< A, D > {}
+impl< A: Send, D: Send > MyTrait< A, D > for Foo {}
+
+fn foo()
+    where
+    for< 'a > u32: 'a,
+{
+}
+
+fn main() {
+    let arr: [ i32; 5 ] = [ 1, 2, 3, 4, 5 ];
+    let arr: [ i32; 500 ] = [ 0; 500 ];
+
+    let v = vec![ 1, 2, 3 ];
+    assert_eq!(arr, [ 1, 2, 3 ]);
+
+    let i = arr[ 0 ];
+
+    let slice = &arr[ 1..2 ];
+
+    let line100_________________________________________________________________________ = [ 1, 2 ];
+    let line101__________________________________________________________________________ =
+        [ 1, 2 ];
+    let line102___________________________________________________________________________ =
+        [ 1, 2 ];
+    let line103____________________________________________________________________________ =
+        [ 1, 2 ];
+    let line104_____________________________________________________________________________ =
+        [ 1, 2 ];
+
+    let line100_____________________________________________________________________ = vec![ 1, 2 ];
+    let line101______________________________________________________________________ =
+        vec![ 1, 2 ];
+    let line102_______________________________________________________________________ =
+        vec![ 1, 2 ];
+    let line103________________________________________________________________________ =
+        vec![ 1, 2 ];
+    let line104_________________________________________________________________________ =
+        vec![ 1, 2 ];
+}
+
+fn f(slice: &[ i32 ]) {}
diff --git a/tests/target/configs-spaces_within_square_brackets-false.rs b/tests/target/configs-spaces_within_square_brackets-false.rs
deleted file mode 100644 (file)
index 6410646..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_square_brackets: false
-// Spaces within square-brackets
-
-fn main() {
-    let lorem: [usize; 2] = [ipsum, dolor];
-}
diff --git a/tests/target/configs-spaces_within_square_brackets-true.rs b/tests/target/configs-spaces_within_square_brackets-true.rs
deleted file mode 100644 (file)
index 25f5e0e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_within_square_brackets: true
-// Spaces within square-brackets
-
-fn main() {
-    let lorem: [ usize; 2 ] = [ ipsum, dolor ];
-}
diff --git a/tests/target/spaces-within-angle-brackets.rs b/tests/target/spaces-within-angle-brackets.rs
deleted file mode 100644 (file)
index 89335b6..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// rustfmt-spaces_within_angle_brackets: true
-
-struct Foo< T > {
-    i: T,
-}
-
-struct Bar< T, E > {
-    i: T,
-    e: E,
-}
-
-struct Foo< 'a > {
-    i: &'a str,
-}
-
-enum E< T > {
-    T(T),
-}
-
-enum E< T, S > {
-    T(T),
-    S(S),
-}
-
-fn foo< T >(a: T) {
-    foo::< u32 >(10);
-}
-
-fn foo< T, E >(a: T, b: E) {
-    foo::< u32, str >(10, "bar");
-}
-
-fn foo< T: Send, E: Send >(a: T, b: E) {
-    foo::< u32, str >(10, "bar");
-
-    let opt: Option< u32 >;
-    let res: Result< u32, String >;
-}
-
-fn foo< 'a >(a: &'a str) {
-    foo("foo");
-}
-
-fn foo< 'a, 'b >(a: &'a str, b: &'b str) {
-    foo("foo", "bar");
-}
-
-impl Foo {
-    fn bar() {
-        < Foo as Foo >::bar();
-    }
-}
-
-trait MyTrait< A, D > {}
-impl< A: Send, D: Send > MyTrait< A, D > for Foo {}
-
-fn foo()
-where
-    for< 'a > u32: 'a,
-{
-}
diff --git a/tests/target/spaces-within-parens.rs b/tests/target/spaces-within-parens.rs
deleted file mode 100644 (file)
index 651386c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// rustfmt-spaces_within_parens: true
-
-enum E {
-    A( u32 ),
-    B( u32, u32 ),
-    C( u32, u32, u32 ),
-    D(),
-}
-
-struct TupleStruct0();
-struct TupleStruct1( u32 );
-struct TupleStruct2( u32, u32 );
-
-fn fooEmpty() {}
-
-fn foo( e: E, _: u32 ) -> ( u32, u32 ) {
-    // Tuples
-    let t1 = ();
-    let t2 = ( 1, );
-    let t3 = ( 1, 2 );
-
-    let ts0 = TupleStruct0();
-    let ts1 = TupleStruct1( 1 );
-    let ts2 = TupleStruct2( 1, 2 );
-
-    // Tuple pattern
-    let ( a, b, c ) = ( 1, 2, 3 );
-
-    // Expressions
-    let x = ( 1 + 2 ) * ( 3 );
-
-    // Function call
-    fooEmpty();
-    foo( 1, 2 );
-
-    // Pattern matching
-    match e {
-        A( _ ) => (),
-        B( _, _ ) => (),
-        C( .. ) => (),
-        D => (),
-    }
-
-    ( 1, 2 )
-}
diff --git a/tests/target/spaces-within-square-brackets.rs b/tests/target/spaces-within-square-brackets.rs
deleted file mode 100644 (file)
index cb468d6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// rustfmt-spaces_within_square_brackets: true
-
-fn main() {
-    let arr: [ i32; 5 ] = [ 1, 2, 3, 4, 5 ];
-    let arr: [ i32; 500 ] = [ 0; 500 ];
-
-    let v = vec![ 1, 2, 3 ];
-    assert_eq!(arr, [ 1, 2, 3 ]);
-
-    let i = arr[ 0 ];
-
-    let slice = &arr[ 1..2 ];
-
-    let line100_________________________________________________________________________ = [ 1, 2 ];
-    let line101__________________________________________________________________________ =
-        [ 1, 2 ];
-    let line102___________________________________________________________________________ =
-        [ 1, 2 ];
-    let line103____________________________________________________________________________ =
-        [ 1, 2 ];
-    let line104_____________________________________________________________________________ =
-        [ 1, 2 ];
-
-    let line100_____________________________________________________________________ = vec![ 1, 2 ];
-    let line101______________________________________________________________________ =
-        vec![ 1, 2 ];
-    let line102_______________________________________________________________________ =
-        vec![ 1, 2 ];
-    let line103________________________________________________________________________ =
-        vec![ 1, 2 ];
-    let line104_________________________________________________________________________ =
-        vec![ 1, 2 ];
-}
-
-fn f(slice: &[ i32 ]) {}