Home
last modified time | relevance | path

Searched refs:verifyFormat (Results 1 – 20 of 20) sorted by relevance

/llvm-project/clang/unittests/Format/
H A DFormatTestJS.cpp48 static void verifyFormat( in verifyFormat() function in clang::format::FormatTestJS
56 static void verifyFormat( in verifyFormat() function in clang::format::FormatTestJS
67 verifyFormat("/* aaaaaaaaaaaaa */ aaaaaaaaaaaaaaaaaaaaaaaaaaa(\n" in TEST_F()
119 verifyFormat("/** jsdoc line 1 */", getGoogleJSStyleWithColumns(20)); in TEST_F()
122 verifyFormat("/** jsdoc line 12 */", getGoogleJSStyleWithColumns(20)); in TEST_F()
184 verifyFormat("/** @returns j */", getGoogleJSStyleWithColumns(20)); in TEST_F()
230 verifyFormat("a == = b;"); in TEST_F()
231 verifyFormat("a != = b;"); in TEST_F()
233 verifyFormat("a === b;"); in TEST_F()
234 verifyFormat("aaaaaa in TEST_F()
[all...]
H A DFormatTestVerilog.cpp30 verifyFormat("x <= x;\n" in TEST_F()
34 verifyFormat("x = x;\n" in TEST_F()
40 verifyFormat("x <= x;\n" in TEST_F()
43 verifyFormat("x += x;\n" in TEST_F()
46 verifyFormat("x <<= x;\n" in TEST_F()
49 verifyFormat("x <<<= x;\n" in TEST_F()
52 verifyFormat("x >>= x;\n" in TEST_F()
55 verifyFormat("x >>>= x;\n" in TEST_F()
59 verifyFormat("x <= x;\n" in TEST_F()
62 verifyFormat(" in TEST_F()
[all...]
H A DFormatTestObjC.cpp32 #define verifyFormat(...) _verifyFormat(__FILE__, __LINE__, __VA_ARGS__) macro
183 verifyFormat("@try {\n" in TEST_F()
190 verifyFormat("DEBUG({\n" in TEST_F()
198 verifyFormat("@autoreleasepool {\n" in TEST_F()
206 verifyFormat("@autoreleasepool\n" in TEST_F()
218 verifyFormat("int aaaaaaaaaaaaaaaa(\n" in TEST_F()
221 verifyFormat("int aaaaaaaaaaaaaaaa(\n" in TEST_F()
228 verifyFormat("@synchronized(self) {\n" in TEST_F()
236 verifyFormat("@synchronized(self)\n" in TEST_F()
247 verifyFormat(" in TEST_F()
[all...]
H A DFormatTest.cpp41 TEST_F(FormatTest, DoesNotChangeCorrectlyFormattedCode) { verifyFormat(";"); } in TEST_F()
44 verifyFormat("int i;", " int i;"); in TEST_F()
45 verifyFormat("\nint i;", " \n\t \v \f int i;"); in TEST_F()
46 verifyFormat("int i;\nint j;", " int i; int j;"); in TEST_F()
47 verifyFormat("int i;\nint j;", " int i;\n int j;"); in TEST_F()
51 verifyFormat("int i;", " \n\t \v \f int i;", Style); in TEST_F()
55 verifyFormat("int i;", "int\ni;"); in TEST_F()
59 verifyFormat("{\n" in TEST_F()
69 verifyFormat("Method(f1, f2(f3));"); in TEST_F()
70 verifyFormat("Metho in TEST_F()
[all...]
H A DQualifierFixerTest.cpp119 verifyFormat("const volatile int a;", Style); in TEST_F()
120 verifyFormat("const volatile int a;", "volatile const int a;", Style); in TEST_F()
121 verifyFormat("const volatile int a;", "int const volatile a;", Style); in TEST_F()
122 verifyFormat("const volatile int a;", "int volatile const a;", Style); in TEST_F()
123 verifyFormat("const volatile int a;", "const int volatile a;", Style); in TEST_F()
125 verifyFormat("static const volatile int a;", "const static int volatile a;", in TEST_F()
127 verifyFormat("inline static const volatile int a;", in TEST_F()
130 verifyFormat("constexpr static int a;", "static constexpr int a;", Style); in TEST_F()
131 verifyFormat("constexpr static int A;", "static constexpr int A;", Style); in TEST_F()
132 verifyFormat("constexp in TEST_F()
[all...]
H A DFormatTestTextProto.cpp26 verifyFormat("field_a: OK field_b: OK field_c: OK field_d: OK field_e: OK");
30 verifyFormat("msg_field: {}");
32 verifyFormat("msg_field: { field_a: A }"); in TEST_F()
34 verifyFormat("msg_field: { field_a: \"OK\" field_b: 123 }"); in TEST_F()
36 verifyFormat("msg_field: {\n" in TEST_F()
44 verifyFormat("msg_field {}"); in TEST_F()
46 verifyFormat("msg_field { field_a: A }"); in TEST_F()
48 verifyFormat("msg_field { field_a: \"OK\" field_b: 123 }"); in TEST_F()
50 verifyFormat("msg_field {\n" in TEST_F()
61 verifyFormat("msg_fiel in TEST_F()
[all...]
H A DObjCPropertyAttributeOrderFixerTest.cpp82 verifyFormat("@property() int p;", Style); in TEST_F()
85 verifyFormat("@property(a) int p;", Style); in TEST_F()
86 verifyFormat("@property(b) int p;", Style); in TEST_F()
87 verifyFormat("@property(c) int p;", Style); in TEST_F()
90 verifyFormat("@property(a, b) int p;", Style); in TEST_F()
91 verifyFormat("@property(a, c) int p;", Style); in TEST_F()
92 verifyFormat("@property(b, c) int p;", Style); in TEST_F()
95 verifyFormat("@property(a, b, c) int p;", Style); in TEST_F()
98 verifyFormat("@property(a, b) int p;", "@property(b, a) int p;", Style); in TEST_F()
99 verifyFormat("@property(a, c) int p;", "@property(c, a) int p;", Style); in TEST_F()
[all …]
H A DFormatTestJava.cpp32 verifyFormat("someObject.and();"); in TEST_F()
36 verifyFormat("a[b >> 1] = (byte) (c() << 4);"); in TEST_F()
41 verifyFormat("return aaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" in TEST_F()
45 verifyFormat("return aaaaaaaaaaaaaaaaaaaaaaaaaaaaa instanceof\n" in TEST_F()
48 verifyFormat("return aaaaaaaaaaaaaaaaaaa instanceof bbbbbbbbbbbbbbbbbbbbbbb\n" in TEST_F()
53 verifyFormat("class SomeClass {\n" in TEST_F()
68 verifyFormat("public some.package.Type someFunction( // comment\n" in TEST_F()
73 verifyFormat("SomeClass.class.getName();"); in TEST_F()
74 verifyFormat("Class c = SomeClass.class;"); in TEST_F()
78 verifyFormat("public class SomeClass {\n" in TEST_F()
[all …]
H A DFormatTestCSharp.cpp50 verifyFormat("public class SomeClass\n" in TEST_F()
75 verifyFormat("public class SomeEmptyClass {}", Style); in TEST_F()
77 verifyFormat("public class SomeTinyClass {\n" in TEST_F()
81 verifyFormat("private class SomeTinyClass {\n" in TEST_F()
85 verifyFormat("protected class SomeTinyClass {\n" in TEST_F()
89 verifyFormat("internal class SomeTinyClass {\n" in TEST_F()
96 verifyFormat("public String toString()\n" in TEST_F()
99 verifyFormat("private String toString()\n" in TEST_F()
102 verifyFormat("protected String toString()\n" in TEST_F()
105 verifyFormat("interna in TEST_F()
[all...]
H A DFormatTestProto.cpp39 static void verifyFormat(StringRef Code) { in verifyFormat() function in clang::format::FormatTestProto
46 verifyFormat("message SomeMessage {\n" in TEST_F()
49 verifyFormat("message SomeMessage {\n" in TEST_F()
52 verifyFormat("message SomeMessage {\n" in TEST_F()
57 verifyFormat("message SomeMessage {\n" in TEST_F()
64 verifyFormat("message SomeMessage {\n" in TEST_F()
90 verifyFormat("optional string operator = 1;"); in TEST_F()
94 verifyFormat("enum Type {\n" in TEST_F()
99 verifyFormat("enum Type {\n" in TEST_F()
102 verifyFormat("enu in TEST_F()
[all...]
H A DBracesRemoverTest.cpp30 verifyFormat("if (isa<FunctionDecl>(D))\n" in TEST_F()
42 verifyFormat("if (isa<VarDecl>(D)) {\n" in TEST_F()
56 verifyFormat("if (isa<VarDecl>(D)) {\n" in TEST_F()
68 verifyFormat("if (isa<FunctionDecl>(D)) {\n" in TEST_F()
82 verifyFormat("if (isa<FunctionDecl>(D))\n" in TEST_F()
93 verifyFormat("if (Tok->is(tok::l_brace)) {\n" in TEST_F()
101 verifyFormat("if (isa<FunctionDecl>(D)) {\n" in TEST_F()
113 verifyFormat("if (isa<FunctionDecl>(D)) {\n" in TEST_F()
129 verifyFormat("if (auto *D = dyn_cast<FunctionDecl>(D)) {\n" in TEST_F()
144 verifyFormat("// clang-format off\n" in TEST_F()
[all …]
H A DFormatTestTableGen.cpp39 static void verifyFormat(StringRef Code) { in verifyFormat() function in clang::format::FormatTestTableGen
44 static void verifyFormat(StringRef Result, StringRef MessedUp) { in verifyFormat() function in clang::format::FormatTestTableGen
48 static void verifyFormat(StringRef Code, const FormatStyle &Style) { in verifyFormat() function in clang::format::FormatTestTableGen
57 verifyFormat("include \"OptParser.td\"\n" in TEST_F()
66 verifyFormat("def flag : Flag<[\"-\", \"--\"], \"foo\">;"); in TEST_F()
70 verifyFormat("def LiteralAndIdentifiers {\n" in TEST_F()
79 verifyFormat("def BangOperators {\n" in TEST_F()
111 verifyFormat("include \"test/IncludeFile.h\""); in TEST_F()
115 verifyFormat("def Types : list<int>, bits<3>, list<list<string>> {}"); in TEST_F()
119 verifyFormat("de in TEST_F()
[all...]
H A DSortIncludesTest.cpp56 verifyFormat("#include \"a.h\"\n" in TEST_F()
63 verifyFormat("// comment\n" in TEST_F()
73 verifyFormat("#include \"a.h\"\n" in TEST_F()
103 verifyFormat("#include <sys/param.h>\n" in TEST_F()
146 verifyFormat("#include \"FormatTestUtils.h\"\n" in TEST_F()
178 verifyFormat("#include \"foo.bar.h\"\n" in TEST_F()
188 verifyFormat("#include \"a.h\"\n" in TEST_F()
198 verifyFormat("#include \"a.h\"\n" in TEST_F()
209 verifyFormat("#include <a>\n" in TEST_F()
245 verifyFormat(Expecte in TEST_F()
[all...]
H A DIntegerLiteralSeparatorTest.cpp28 verifyFormat(Binary, Style); in TEST_F()
30 verifyFormat("b = 0b100111101101u;", Binary, Style); in TEST_F()
32 verifyFormat("b = 0b1'0'0'1'1'1'1'0'1'1'0'1u;", Binary, Style); in TEST_F()
34 verifyFormat("b = 0b1001'1110'1101u;", Binary, Style); in TEST_F()
37 verifyFormat(Decimal, Style); in TEST_F()
39 verifyFormat("d = 18446744073709550592Ull;", Decimal, Style); in TEST_F()
41 verifyFormat("d = 18'446'744'073'709'550'592Ull;", Decimal, Style); in TEST_F()
44 verifyFormat(Hex, Style); in TEST_F()
46 verifyFormat("h = 0xDEADBEEFDEADBEEFuz;", Hex, Style); in TEST_F()
48 verifyFormat("h = 0xDE'AD'BE'EF'DE'AD'BE'EFuz;", Hex, Style); in TEST_F()
[all …]
H A DBracesInserterTest.cpp24 verifyFormat("// clang-format off\n" in TEST_F()
38 verifyFormat("if (a) {\n" in TEST_F()
57 verifyFormat("for (auto node : nodes) {\n" in TEST_F()
67 verifyFormat("for (auto node : nodes) {\n" in TEST_F()
74 verifyFormat("do {\n" in TEST_F()
82 verifyFormat("if (i) {\n" in TEST_F()
94 verifyFormat("void f() {\n" in TEST_F()
108 verifyFormat("f({\n" in TEST_F()
119 verifyFormat("if (a) {\n" in TEST_F()
134 verifyFormat("if (a) {\n" in TEST_F()
[all …]
H A DFormatTestComments.cpp27 verifyFormat("//* */"); in TEST_F()
28 verifyFormat("// line 1\n" in TEST_F()
40 verifyFormat("void f() {\n" in TEST_F()
43 verifyFormat("SomeObject\n" in TEST_F()
46 verifyFormat("auto result = SomeObject\n" in TEST_F()
49 verifyFormat("void f(int i, // some comment (probably for i)\n" in TEST_F()
52 verifyFormat("void f(int i,\n" in TEST_F()
58 verifyFormat("int i // This is a fancy variable\n" in TEST_F()
61 verifyFormat("// Leading comment.\n" in TEST_F()
63 verifyFormat("in in TEST_F()
[all...]
H A DFormatTestMacroExpansion.cpp32 verifyFormat("ID(nested(a(b, c), d))", Style); in TEST_F()
33 verifyFormat("CLASS\n" in TEST_F()
37 verifyFormat("SEMI\n" in TEST_F()
41 verifyFormat("STMT\n" in TEST_F()
45 verifyFormat("void f() { ID(a *b); }", Style); in TEST_F()
46 verifyFormat("ID(\n" in TEST_F()
56 verifyFormat("ID(CALL(CALL(return a * b;)));", Style); in TEST_F()
58 verifyFormat("ASSIGN_OR_RETURN(MySomewhatLongType *variable,\n" in TEST_F()
61 verifyFormat("ASSIGN_OR_RETURN(MySomewhatLongType *variable,\n" in TEST_F()
66 verifyFormat(R"( in TEST_F()
[all …]
H A DFormatTestJson.cpp66 verifyFormat(StringRef Code, in verifyFormat() function in clang::format::FormatTestJson
74 verifyFormat("{}"); in TEST_F()
75 verifyFormat("{\n" in TEST_F()
78 verifyFormat("{\n" in TEST_F()
81 verifyFormat("{\n" in TEST_F()
86 verifyFormat("{\n" in TEST_F()
94 verifyFormat("{\n" in TEST_F()
102 verifyFormat("{\n" in TEST_F()
114 verifyFormat(R"({ in TEST_F()
141 verifyFormat("[]"); in TEST_F()
[all …]
H A DDefinitionBlockSeparatorTest.cpp88 #define verifyFormat(...) _verifyFormat(__FILE__, __LINE__, __VA_ARGS__) macro
93 verifyFormat("int foo(int i, int j) {\n" in TEST_F()
104 verifyFormat("struct foo {\n" in TEST_F()
113 verifyFormat("union foo {\n" in TEST_F()
122 verifyFormat("class foo {\n" in TEST_F()
131 verifyFormat("namespace foo {\n" in TEST_F()
140 verifyFormat("enum Foo { FOO, BAR };\n" in TEST_F()
148 verifyFormat("class Foo {\n" in TEST_F()
205 verifyFormat(removeEmptyLines(Prefix) + "\n" + CommentedCode + "\n" + in TEST_F()
208 verifyFormat(removeEmptyLines(Prefix) + "\n" + CommentedCode + in TEST_F()
[all …]
H A DFormatTestBase.h156 #define verifyFormat(...) _verifyFormat(__FILE__, __LINE__, __VA_ARGS__) macro
157 #define verifyGoogleFormat(Code) verifyFormat(Code, getGoogleStyle())