Lines Matching refs:Spaces

10052   FormatStyle Spaces = getLLVMStyle();  in TEST_F()  local
10053 Spaces.SpacesInCStyleCastParentheses = true; in TEST_F()
10054 verifyFormat("Deleted &operator=(const Deleted &) & = default;", Spaces); in TEST_F()
10055 verifyFormat("SomeType MemberFunction(const Deleted &) & = delete;", Spaces); in TEST_F()
10056 verifyFormat("Deleted &operator=(const Deleted &) &;", Spaces); in TEST_F()
10057 verifyFormat("SomeType MemberFunction(const Deleted &) &;", Spaces); in TEST_F()
10059 Spaces.SpacesInCStyleCastParentheses = false; in TEST_F()
10060 Spaces.SpacesInParentheses = true; in TEST_F()
10061 verifyFormat("Deleted &operator=( const Deleted & ) & = default;", Spaces); in TEST_F()
10063 Spaces); in TEST_F()
10064 verifyFormat("Deleted &operator=( const Deleted & ) &;", Spaces); in TEST_F()
10065 verifyFormat("SomeType MemberFunction( const Deleted & ) &;", Spaces); in TEST_F()
15588 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
15589 Spaces.SpaceAfterLogicalNot = true; in TEST_F()
15591 verifyFormat("bool x = ! y", Spaces); in TEST_F()
15592 verifyFormat("if (! isFailure())", Spaces); in TEST_F()
15593 verifyFormat("if (! (a && b))", Spaces); in TEST_F()
15594 verifyFormat("\"Error!\"", Spaces); in TEST_F()
15595 verifyFormat("! ! x", Spaces); in TEST_F()
15599 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
15601 Spaces.SpacesInParentheses = true; in TEST_F()
15602 verifyFormat("do_something( ::globalVar );", Spaces); in TEST_F()
15603 verifyFormat("call( x, y, z );", Spaces); in TEST_F()
15604 verifyFormat("call();", Spaces); in TEST_F()
15605 verifyFormat("std::function<void( int, int )> callback;", Spaces); in TEST_F()
15607 Spaces); in TEST_F()
15610 Spaces); in TEST_F()
15613 Spaces); in TEST_F()
15618 Spaces); in TEST_F()
15622 Spaces); in TEST_F()
15627 Spaces); in TEST_F()
15629 Spaces.SpacesInParentheses = false; in TEST_F()
15630 Spaces.SpacesInCStyleCastParentheses = true; in TEST_F()
15631 verifyFormat("Type *A = ( Type * )P;", Spaces); in TEST_F()
15632 verifyFormat("Type *A = ( vector<Type *, int *> )P;", Spaces); in TEST_F()
15633 verifyFormat("x = ( int32 )y;", Spaces); in TEST_F()
15634 verifyFormat("int a = ( int )(2.0f);", Spaces); in TEST_F()
15635 verifyFormat("#define AA(X) sizeof((( X * )NULL)->a)", Spaces); in TEST_F()
15636 verifyFormat("my_int a = ( my_int )sizeof(int);", Spaces); in TEST_F()
15637 verifyFormat("#define x (( int )-1)", Spaces); in TEST_F()
15640 Spaces.SpacesInParentheses = false; in TEST_F()
15641 Spaces.SpaceInEmptyParentheses = true; in TEST_F()
15642 Spaces.SpacesInCStyleCastParentheses = true; in TEST_F()
15643 verifyFormat("call(x, y, z);", Spaces); in TEST_F()
15644 verifyFormat("call( );", Spaces); in TEST_F()
15645 verifyFormat("std::function<void(int, int)> callback;", Spaces); in TEST_F()
15648 Spaces); in TEST_F()
15651 Spaces); in TEST_F()
15656 Spaces); in TEST_F()
15660 Spaces); in TEST_F()
15665 Spaces); in TEST_F()
15668 Spaces.SpaceAfterCStyleCast = true; in TEST_F()
15669 verifyFormat("call(x, y, z);", Spaces); in TEST_F()
15670 verifyFormat("call( );", Spaces); in TEST_F()
15671 verifyFormat("std::function<void(int, int)> callback;", Spaces); in TEST_F()
15674 Spaces); in TEST_F()
15677 Spaces); in TEST_F()
15682 Spaces); in TEST_F()
15686 Spaces); in TEST_F()
15691 Spaces); in TEST_F()
15692 verifyFormat("#define CONF_BOOL(x) ( bool * ) ( void * ) (x)", Spaces); in TEST_F()
15693 verifyFormat("#define CONF_BOOL(x) ( bool * ) (x)", Spaces); in TEST_F()
15694 verifyFormat("#define CONF_BOOL(x) ( bool ) (x)", Spaces); in TEST_F()
15695 verifyFormat("bool *y = ( bool * ) ( void * ) (x);", Spaces); in TEST_F()
15696 verifyFormat("bool *y = ( bool * ) (x);", Spaces); in TEST_F()
15699 Spaces.SpacesInCStyleCastParentheses = false; in TEST_F()
15700 Spaces.SpaceAfterCStyleCast = true; in TEST_F()
15703 Spaces); in TEST_F()
15707 Spaces); in TEST_F()
15709 verifyFormat("size_t idx = (size_t) (ptr - ((char *) file));", Spaces); in TEST_F()
15710 verifyFormat("size_t idx = (size_t) a;", Spaces); in TEST_F()
15711 verifyFormat("size_t idx = (size_t) (a - 1);", Spaces); in TEST_F()
15712 verifyFormat("size_t idx = (a->*foo)(a - 1);", Spaces); in TEST_F()
15713 verifyFormat("size_t idx = (a->foo)(a - 1);", Spaces); in TEST_F()
15714 verifyFormat("size_t idx = (*foo)(a - 1);", Spaces); in TEST_F()
15715 verifyFormat("size_t idx = (*(foo))(a - 1);", Spaces); in TEST_F()
15716 verifyFormat("#define CONF_BOOL(x) (bool *) (void *) (x)", Spaces); in TEST_F()
15717 verifyFormat("#define CONF_BOOL(x) (bool *) (void *) (int) (x)", Spaces); in TEST_F()
15718 verifyFormat("bool *y = (bool *) (void *) (x);", Spaces); in TEST_F()
15719 verifyFormat("bool *y = (bool *) (void *) (int) (x);", Spaces); in TEST_F()
15720 verifyFormat("bool *y = (bool *) (void *) (int) foo(x);", Spaces); in TEST_F()
15721 Spaces.ColumnLimit = 80; in TEST_F()
15722 Spaces.IndentWidth = 4; in TEST_F()
15723 Spaces.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak; in TEST_F()
15730 Spaces); in TEST_F()
15731 Spaces.SpaceAfterCStyleCast = false; in TEST_F()
15732 verifyFormat("size_t idx = (size_t)(ptr - ((char *)file));", Spaces); in TEST_F()
15733 verifyFormat("size_t idx = (size_t)a;", Spaces); in TEST_F()
15734 verifyFormat("size_t idx = (size_t)(a - 1);", Spaces); in TEST_F()
15735 verifyFormat("size_t idx = (a->*foo)(a - 1);", Spaces); in TEST_F()
15736 verifyFormat("size_t idx = (a->foo)(a - 1);", Spaces); in TEST_F()
15737 verifyFormat("size_t idx = (*foo)(a - 1);", Spaces); in TEST_F()
15738 verifyFormat("size_t idx = (*(foo))(a - 1);", Spaces); in TEST_F()
15746 Spaces); in TEST_F()
15753 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
15754 Spaces.SpacesInSquareBrackets = true; in TEST_F()
15756 verifyFormat("int a[ 5 ];", Spaces); in TEST_F()
15757 verifyFormat("a[ 3 ] += 42;", Spaces); in TEST_F()
15758 verifyFormat("constexpr char hello[]{\"hello\"};", Spaces); in TEST_F()
15761 Spaces); in TEST_F()
15762 verifyFormat("std::unique_ptr<int[]> foo() {}", Spaces); in TEST_F()
15763 verifyFormat("int i = a[ a ][ a ]->f();", Spaces); in TEST_F()
15764 verifyFormat("int i = (*b)[ a ]->f();", Spaces); in TEST_F()
15766 verifyFormat("int c = []() -> int { return 2; }();\n", Spaces); in TEST_F()
15767 verifyFormat("return [ i, args... ] {};", Spaces); in TEST_F()
15768 verifyFormat("int foo = [ &bar ]() {};", Spaces); in TEST_F()
15769 verifyFormat("int foo = [ = ]() {};", Spaces); in TEST_F()
15770 verifyFormat("int foo = [ & ]() {};", Spaces); in TEST_F()
15771 verifyFormat("int foo = [ =, &bar ]() {};", Spaces); in TEST_F()
15772 verifyFormat("int foo = [ &bar, = ]() {};", Spaces); in TEST_F()
15815 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
15816 Spaces.SpaceBeforeAssignmentOperators = false; in TEST_F()
15817 verifyFormat("int a= 5;", Spaces); in TEST_F()
15818 verifyFormat("a+= 42;", Spaces); in TEST_F()
15819 verifyFormat("a or_eq 8;", Spaces); in TEST_F()
16132 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
16133 Spaces.AttributeMacros.push_back("qualified"); in TEST_F()
16134 Spaces.PointerAlignment = FormatStyle::PAS_Right; in TEST_F()
16135 Spaces.SpaceAroundPointerQualifiers = FormatStyle::SAPQ_Default; in TEST_F()
16136 verifyFormat("SomeType *volatile *a = NULL;", Spaces); in TEST_F()
16137 verifyFormat("SomeType *__attribute__((attr)) *a = NULL;", Spaces); in TEST_F()
16138 verifyFormat("std::vector<SomeType *const *> x;", Spaces); in TEST_F()
16139 verifyFormat("std::vector<SomeType *qualified *> x;", Spaces); in TEST_F()
16140 verifyFormat("std::vector<SomeVar * NotAQualifier> x;", Spaces); in TEST_F()
16141 Spaces.SpaceAroundPointerQualifiers = FormatStyle::SAPQ_Before; in TEST_F()
16142 verifyFormat("SomeType * volatile *a = NULL;", Spaces); in TEST_F()
16143 verifyFormat("SomeType * __attribute__((attr)) *a = NULL;", Spaces); in TEST_F()
16144 verifyFormat("std::vector<SomeType * const *> x;", Spaces); in TEST_F()
16145 verifyFormat("std::vector<SomeType * qualified *> x;", Spaces); in TEST_F()
16146 verifyFormat("std::vector<SomeVar * NotAQualifier> x;", Spaces); in TEST_F()
16149 Spaces.PointerAlignment = FormatStyle::PAS_Left; in TEST_F()
16150 Spaces.SpaceAroundPointerQualifiers = FormatStyle::SAPQ_Before; in TEST_F()
16151 verifyFormat("SomeType* volatile* a = NULL;", Spaces); in TEST_F()
16152 verifyFormat("SomeType* __attribute__((attr))* a = NULL;", Spaces); in TEST_F()
16153 verifyFormat("std::vector<SomeType* const*> x;", Spaces); in TEST_F()
16154 verifyFormat("std::vector<SomeType* qualified*> x;", Spaces); in TEST_F()
16155 verifyFormat("std::vector<SomeVar * NotAQualifier> x;", Spaces); in TEST_F()
16157 Spaces.SpaceAroundPointerQualifiers = FormatStyle::SAPQ_After; in TEST_F()
16158 verifyFormat("SomeType* volatile * a = NULL;", Spaces); in TEST_F()
16159 verifyFormat("SomeType* __attribute__((attr)) * a = NULL;", Spaces); in TEST_F()
16160 verifyFormat("std::vector<SomeType* const *> x;", Spaces); in TEST_F()
16161 verifyFormat("std::vector<SomeType* qualified *> x;", Spaces); in TEST_F()
16162 verifyFormat("std::vector<SomeVar * NotAQualifier> x;", Spaces); in TEST_F()
16165 Spaces.PointerAlignment = FormatStyle::PAS_Middle; in TEST_F()
16166 Spaces.SpaceAroundPointerQualifiers = FormatStyle::SAPQ_After; in TEST_F()
16167 verifyFormat("SomeType * volatile * a = NULL;", Spaces); in TEST_F()
16168 verifyFormat("SomeType * __attribute__((attr)) * a = NULL;", Spaces); in TEST_F()
16169 verifyFormat("std::vector<SomeType * const *> x;", Spaces); in TEST_F()
16170 verifyFormat("std::vector<SomeType * qualified *> x;", Spaces); in TEST_F()
16171 verifyFormat("std::vector<SomeVar * NotAQualifier> x;", Spaces); in TEST_F()
22584 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
22585 Spaces.SpacesInAngles = FormatStyle::SIAS_Always; in TEST_F()
22587 verifyFormat("vector< ::std::string > x1;", Spaces); in TEST_F()
22588 verifyFormat("Foo< int, Bar > x2;", Spaces); in TEST_F()
22589 verifyFormat("Foo< ::int, ::Bar > x3;", Spaces); in TEST_F()
22591 verifyFormat("static_cast< int >(arg);", Spaces); in TEST_F()
22592 verifyFormat("template < typename T0, typename T1 > void f() {}", Spaces); in TEST_F()
22593 verifyFormat("f< int, float >();", Spaces); in TEST_F()
22594 verifyFormat("template <> g() {}", Spaces); in TEST_F()
22595 verifyFormat("template < std::vector< int > > f() {}", Spaces); in TEST_F()
22596 verifyFormat("std::function< void(int, int) > fct;", Spaces); in TEST_F()
22598 Spaces); in TEST_F()
22600 Spaces.Standard = FormatStyle::LS_Cpp03; in TEST_F()
22601 Spaces.SpacesInAngles = FormatStyle::SIAS_Always; in TEST_F()
22602 verifyFormat("A< A< int > >();", Spaces); in TEST_F()
22604 Spaces.SpacesInAngles = FormatStyle::SIAS_Never; in TEST_F()
22605 verifyFormat("A<A<int> >();", Spaces); in TEST_F()
22607 Spaces.SpacesInAngles = FormatStyle::SIAS_Leave; in TEST_F()
22609 Spaces); in TEST_F()
22611 Spaces); in TEST_F()
22613 verifyFormat("A<A<int> >();", Spaces); in TEST_F()
22614 verifyFormat("A<A<int> >();", "A<A<int>>();", Spaces); in TEST_F()
22615 verifyFormat("A< A< int > >();", Spaces); in TEST_F()
22617 Spaces.Standard = FormatStyle::LS_Cpp11; in TEST_F()
22618 Spaces.SpacesInAngles = FormatStyle::SIAS_Always; in TEST_F()
22619 verifyFormat("A< A< int > >();", Spaces); in TEST_F()
22621 Spaces.SpacesInAngles = FormatStyle::SIAS_Never; in TEST_F()
22622 verifyFormat("vector<::std::string> x4;", Spaces); in TEST_F()
22623 verifyFormat("vector<int> x5;", Spaces); in TEST_F()
22624 verifyFormat("Foo<int, Bar> x6;", Spaces); in TEST_F()
22625 verifyFormat("Foo<::int, ::Bar> x7;", Spaces); in TEST_F()
22627 verifyFormat("A<A<int>>();", Spaces); in TEST_F()
22629 Spaces.SpacesInAngles = FormatStyle::SIAS_Leave; in TEST_F()
22630 verifyFormat("vector<::std::string> x4;", Spaces); in TEST_F()
22631 verifyFormat("vector< ::std::string > x4;", Spaces); in TEST_F()
22632 verifyFormat("vector<int> x5;", Spaces); in TEST_F()
22633 verifyFormat("vector< int > x5;", Spaces); in TEST_F()
22634 verifyFormat("Foo<int, Bar> x6;", Spaces); in TEST_F()
22635 verifyFormat("Foo< int, Bar > x6;", Spaces); in TEST_F()
22636 verifyFormat("Foo<::int, ::Bar> x7;", Spaces); in TEST_F()
22637 verifyFormat("Foo< ::int, ::Bar > x7;", Spaces); in TEST_F()
22639 verifyFormat("A<A<int>>();", Spaces); in TEST_F()
22640 verifyFormat("A< A< int > >();", Spaces); in TEST_F()
22641 verifyFormat("A<A<int > >();", Spaces); in TEST_F()
22642 verifyFormat("A< A< int>>();", Spaces); in TEST_F()
22644 Spaces.SpacesInAngles = FormatStyle::SIAS_Always; in TEST_F()
22648 Spaces); in TEST_F()
22652 Spaces); in TEST_F()
22855 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
22856 Spaces.SpacesInSquareBrackets = true; in TEST_F()
22858 format("auto a = new unique_ptr<int > [10];", Spaces)); in TEST_F()
22865 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
22866 Spaces.SpacesInSquareBrackets = true; in TEST_F()
22868 format("auto a = unique_ptr < Foo < Bar>[10]> ;", Spaces)); in TEST_F()
23294 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
23295 Spaces.SpacesInSquareBrackets = true; in TEST_F()
23296 verifyFormat("auto [ a, b ] = f();", Spaces); in TEST_F()
23297 verifyFormat("auto &&[ a, b ] = f();", Spaces); in TEST_F()
23298 verifyFormat("auto &[ a, b ] = f();", Spaces); in TEST_F()
23299 verifyFormat("auto const &&[ a, b ] = f();", Spaces); in TEST_F()
23300 verifyFormat("auto const &[ a, b ] = f();", Spaces); in TEST_F()
23555 FormatStyle Spaces = getLLVMStyle(); in TEST_F() local
23556 Spaces.IfMacros.clear(); in TEST_F()
23557 Spaces.IfMacros.push_back("MYIF"); in TEST_F()
23558 Spaces.SpacesInConditionalStatement = true; in TEST_F()
23559 verifyFormat("for ( int i = 0; i; i++ )\n continue;", Spaces); in TEST_F()
23560 verifyFormat("if ( !a )\n return;", Spaces); in TEST_F()
23561 verifyFormat("if ( a )\n return;", Spaces); in TEST_F()
23562 verifyFormat("if constexpr ( a )\n return;", Spaces); in TEST_F()
23563 verifyFormat("MYIF ( a )\n return;", Spaces); in TEST_F()
23564 verifyFormat("MYIF ( a )\n return;\nelse MYIF ( b )\n return;", Spaces); in TEST_F()
23565 verifyFormat("MYIF ( a )\n return;\nelse\n return;", Spaces); in TEST_F()
23566 verifyFormat("switch ( a )\ncase 1:\n return;", Spaces); in TEST_F()
23567 verifyFormat("while ( a )\n return;", Spaces); in TEST_F()
23568 verifyFormat("while ( (a && b) )\n return;", Spaces); in TEST_F()
23569 verifyFormat("do {\n} while ( 1 != 0 );", Spaces); in TEST_F()
23570 verifyFormat("try {\n} catch ( const std::exception & ) {\n}", Spaces); in TEST_F()
23573 verifyFormat("while ( ::func() )\n return;", Spaces); in TEST_F()
23576 Spaces.SpaceBeforeParens = in TEST_F()
23578 verifyFormat("MYIF( a )\n return;", Spaces); in TEST_F()
23579 verifyFormat("MYIF( a )\n return;\nelse MYIF( b )\n return;", Spaces); in TEST_F()
23580 verifyFormat("MYIF( a )\n return;\nelse\n return;", Spaces); in TEST_F()