Lines Matching full:n
24 DEBUG(llvm::errs() << "---\n"); in format()
25 DEBUG(llvm::errs() << Code << "\n\n"); in format()
30 EXPECT_FALSE(IncompleteFormat) << Code << "\n\n"; in format()
33 DEBUG(llvm::errs() << "\n" << Result << "\n\n"); in format()
43 EXPECT_EQ("int a;\n", format("int a; \n \n \n ", 0, 0)); in TEST_F()
48 EXPECT_EQ("{int b;\n" in TEST_F()
49 " int a;\n" in TEST_F()
51 format("{int b;\n int a;}", 8, 0)); in TEST_F()
52 EXPECT_EQ("{\n" in TEST_F()
53 " int b;\n" in TEST_F()
55 format("{int b;\n int a;}", 7, 0)); in TEST_F()
58 EXPECT_EQ("#define A \\\n" in TEST_F()
59 " int a; \\\n" in TEST_F()
61 format("#define A \\\n" in TEST_F()
62 " int a; \\\n" in TEST_F()
65 EXPECT_EQ("#define A \\\n" in TEST_F()
66 " int a; \\\n" in TEST_F()
68 format("#define A \\\n" in TEST_F()
69 " int a; \\\n" in TEST_F()
75 EXPECT_EQ("int b;\n\nint a;", format("int b;\n\nint a;", 8, 0)); in TEST_F()
76 EXPECT_EQ("int b;\n\nint a;", format("int b;\n\nint a;", 7, 0)); in TEST_F()
84 EXPECT_EQ("int a;\n\n int b;", format("int a;\n \n\n int b;", 8, 0)); in TEST_F()
85 EXPECT_EQ("int a;\n\n int b;", format("int a;\n \n\n int b;", 9, 0)); in TEST_F()
90 "template <typename T> T *getFETokenInfo() const {\n" in TEST_F()
91 " return static_cast<T *>(FETokenInfo);\n" in TEST_F()
92 "}\n" in TEST_F()
95 "template<typename T>\n" in TEST_F()
96 "T *getFETokenInfo() const { return static_cast<T*>(FETokenInfo); }\n" in TEST_F()
109 EXPECT_EQ("int a; // comment\n" in TEST_F()
111 format("int a; // comment\n" in TEST_F()
114 EXPECT_EQ("int a; // comment\n" in TEST_F()
115 " // line 2\n" in TEST_F()
117 format("int a; // comment\n" in TEST_F()
118 " // line 2\n" in TEST_F()
121 EXPECT_EQ("int aaaaaa; // comment\n" in TEST_F()
122 "int b;\n" in TEST_F()
124 format("int aaaaaa; // comment\n" in TEST_F()
125 "int b;\n" in TEST_F()
129 EXPECT_EQ("int a; // This\n" in TEST_F()
130 " // is\n" in TEST_F()
132 format("int a; // This\n" in TEST_F()
133 " // is\n" in TEST_F()
136 EXPECT_EQ("int a; // This\n" in TEST_F()
137 " // is\n" in TEST_F()
138 " // a\n" in TEST_F()
139 "// This is b\n" in TEST_F()
141 format("int a; // This\n" in TEST_F()
142 " // is\n" in TEST_F()
143 " // a\n" in TEST_F()
144 "// This is b\n" in TEST_F()
147 EXPECT_EQ("int a; // This\n" in TEST_F()
148 " // is\n" in TEST_F()
149 " // a\n" in TEST_F()
150 "\n" in TEST_F()
152 format("int a; // This\n" in TEST_F()
153 " // is\n" in TEST_F()
154 " // a\n" in TEST_F()
155 "\n" in TEST_F()
158 EXPECT_EQ("int a;\n" in TEST_F()
159 "// This is\n" in TEST_F()
161 format("int a;\n" in TEST_F()
162 "// This is\n" in TEST_F()
168 EXPECT_EQ("DEBUG({\n" in TEST_F()
169 " int i;\n" in TEST_F()
170 " int j;\n" in TEST_F()
172 format("DEBUG( {\n" in TEST_F()
173 " int i;\n" in TEST_F()
174 " int j;\n" in TEST_F()
177 EXPECT_EQ("DEBUG( {\n" in TEST_F()
178 " int i;\n" in TEST_F()
179 " int j;\n" in TEST_F()
181 format("DEBUG( {\n" in TEST_F()
182 " int i;\n" in TEST_F()
183 " int j;\n" in TEST_F()
186 EXPECT_EQ("DEBUG( {\n" in TEST_F()
187 " int i;\n" in TEST_F()
188 " int j;\n" in TEST_F()
190 format("DEBUG( {\n" in TEST_F()
191 " int i;\n" in TEST_F()
192 " int j;\n" in TEST_F()
195 EXPECT_EQ("DEBUG({\n" in TEST_F()
196 " int i;\n" in TEST_F()
197 " int j;\n" in TEST_F()
199 format("DEBUG( {\n" in TEST_F()
200 " int i;\n" in TEST_F()
201 " int j;\n" in TEST_F()
205 EXPECT_EQ("Debug({\n" in TEST_F()
206 " if (aaaaaaaaaaaaaaaaaaaaaaaa)\n" in TEST_F()
207 " return;\n" in TEST_F()
208 " },\n" in TEST_F()
210 format("Debug({\n" in TEST_F()
211 " if (aaaaaaaaaaaaaaaaaaaaaaaa)\n" in TEST_F()
212 " return;\n" in TEST_F()
213 " },\n" in TEST_F()
216 EXPECT_EQ("DEBUG({\n" in TEST_F()
217 " DEBUG({\n" in TEST_F()
218 " int a;\n" in TEST_F()
219 " int b;\n" in TEST_F()
220 " }) ;\n" in TEST_F()
222 format("DEBUG({\n" in TEST_F()
223 " DEBUG({\n" in TEST_F()
224 " int a;\n" in TEST_F()
225 " int b;\n" // Format this line only. in TEST_F()
226 " }) ;\n" // Don't touch this line. in TEST_F()
229 EXPECT_EQ("DEBUG({\n" in TEST_F()
230 " int a; //\n" in TEST_F()
232 format("DEBUG({\n" in TEST_F()
233 " int a; //\n" in TEST_F()
236 EXPECT_EQ("someFunction(\n" in TEST_F()
237 " [] {\n" in TEST_F()
238 " // Only with this comment.\n" in TEST_F()
239 " int i; // invoke formatting here.\n" in TEST_F()
240 " }, // force line break\n" in TEST_F()
242 format("someFunction(\n" in TEST_F()
243 " [] {\n" in TEST_F()
244 " // Only with this comment.\n" in TEST_F()
245 " int i; // invoke formatting here.\n" in TEST_F()
246 " }, // force line break\n" in TEST_F()
250 EXPECT_EQ("int longlongname; // comment\n" in TEST_F()
251 "int x = f({\n" in TEST_F()
252 " int x; // comment\n" in TEST_F()
253 " int y; // comment\n" in TEST_F()
255 format("int longlongname; // comment\n" in TEST_F()
256 "int x = f({\n" in TEST_F()
257 " int x; // comment\n" in TEST_F()
258 " int y; // comment\n" in TEST_F()
261 EXPECT_EQ("int s = f({\n" in TEST_F()
262 " class X {\n" in TEST_F()
263 " public:\n" in TEST_F()
264 " void f();\n" in TEST_F()
265 " };\n" in TEST_F()
267 format("int s = f({\n" in TEST_F()
268 " class X {\n" in TEST_F()
269 " public:\n" in TEST_F()
270 " void f();\n" in TEST_F()
271 " };\n" in TEST_F()
277 EXPECT_EQ("namespace {\n" in TEST_F()
278 "int i;\n" in TEST_F()
279 "int j;\n" in TEST_F()
281 format("namespace {\n" in TEST_F()
282 " int i;\n" // Format here. in TEST_F()
283 " int j;\n" in TEST_F()
286 EXPECT_EQ("namespace {\n" in TEST_F()
287 " int i;\n" in TEST_F()
288 " int j;\n" in TEST_F()
290 format("namespace {\n" in TEST_F()
291 " int i;\n" in TEST_F()
292 " int j;\n" // Format here. in TEST_F()
299 EXPECT_EQ("int i;\n" in TEST_F()
300 "#define A \\\n" in TEST_F()
301 " int i; \\\n" in TEST_F()
302 " int j\n" in TEST_F()
304 format("int i;\n" in TEST_F()
305 "#define A \\\n" in TEST_F()
306 " int i ; \\\n" in TEST_F()
307 " int j\n" in TEST_F()
310 EXPECT_EQ("int i;\n" in TEST_F()
311 "#define A \\\n" in TEST_F()
312 " int i; \\\n" in TEST_F()
313 " int j\n" in TEST_F()
315 format("int i;\n" in TEST_F()
316 "#define A \\\n" in TEST_F()
317 " int i ; \\\n" in TEST_F()
318 " int j\n" in TEST_F()
324 EXPECT_EQ("{\n" in TEST_F()
325 "{\n" in TEST_F()
326 "a;\n" in TEST_F()
327 "b;\n" in TEST_F()
328 "}\n" in TEST_F()
330 format("{\n" in TEST_F()
331 "{\n" in TEST_F()
332 "a;\n" in TEST_F()
333 " b;\n" in TEST_F()
334 "}\n" in TEST_F()
337 EXPECT_EQ("{\n" in TEST_F()
338 "{\n" in TEST_F()
339 " a;\n" in TEST_F()
340 " b;\n" in TEST_F()
341 " c;\n" in TEST_F()
342 " d;\n" in TEST_F()
343 "}\n" in TEST_F()
345 format("{\n" in TEST_F()
346 "{\n" in TEST_F()
347 " a;\n" in TEST_F()
348 " b;\n" in TEST_F()
349 " c;\n" in TEST_F()
350 " d;\n" in TEST_F()
351 "}\n" in TEST_F()
354 EXPECT_EQ("{\n" in TEST_F()
355 "{\n" in TEST_F()
356 "public:\n" in TEST_F()
357 " b;\n" in TEST_F()
358 "}\n" in TEST_F()
360 format("{\n" in TEST_F()
361 "{\n" in TEST_F()
362 "public:\n" in TEST_F()
363 " b;\n" in TEST_F()
364 "}\n" in TEST_F()
367 EXPECT_EQ("{\n" in TEST_F()
368 "{\n" in TEST_F()
369 "a;\n" in TEST_F()
370 "}\n" in TEST_F()
371 "{\n" in TEST_F()
372 " b; //\n" in TEST_F()
373 "}\n" in TEST_F()
375 format("{\n" in TEST_F()
376 "{\n" in TEST_F()
377 "a;\n" in TEST_F()
378 "}\n" in TEST_F()
379 "{\n" in TEST_F()
380 " b; //\n" in TEST_F()
381 "}\n" in TEST_F()
384 EXPECT_EQ(" {\n" in TEST_F()
385 " a; //\n" in TEST_F()
387 format(" {\n" in TEST_F()
388 "a; //\n" in TEST_F()
391 EXPECT_EQ("void f() {}\n" in TEST_F()
393 format("void f() {}\n" in TEST_F()
396 EXPECT_EQ("int a; // comment\n" in TEST_F()
397 " // line 2\n" in TEST_F()
399 format("int a; // comment\n" in TEST_F()
400 " // line 2\n" in TEST_F()
404 EXPECT_EQ(" void f() {\n" in TEST_F()
405 "#define A 1\n" in TEST_F()
407 format(" void f() {\n" in TEST_F()
408 " #define A 1\n" // Format this line. in TEST_F()
411 EXPECT_EQ(" void f() {\n" in TEST_F()
412 " int i;\n" in TEST_F()
413 "#define A \\\n" in TEST_F()
414 " int i; \\\n" in TEST_F()
415 " int j;\n" in TEST_F()
416 " int k;\n" in TEST_F()
418 format(" void f() {\n" in TEST_F()
419 " int i;\n" in TEST_F()
420 "#define A \\\n" in TEST_F()
421 " int i; \\\n" in TEST_F()
422 " int j;\n" in TEST_F()
423 " int k;\n" // Format this line. in TEST_F()
428 EXPECT_EQ(" int a;\n" in TEST_F()
429 " void\n" in TEST_F()
430 " ffffff() {\n" in TEST_F()
432 format(" int a;\n" in TEST_F()
441 EXPECT_EQ("void f() {\n" in TEST_F()
442 "\tf();\n" in TEST_F()
443 "\tg();\n" in TEST_F()
445 format("void f() {\n" in TEST_F()
446 "\tf();\n" in TEST_F()
447 "\tg();\n" in TEST_F()
450 EXPECT_EQ("void f() {\n" in TEST_F()
451 "\tf();\n" in TEST_F()
452 "\tg();\n" in TEST_F()
454 format("void f() {\n" in TEST_F()
455 "\tf();\n" in TEST_F()
456 "\tg();\n" in TEST_F()
459 EXPECT_EQ("void f() {\n" in TEST_F()
460 " \tf();\n" in TEST_F()
461 "\tg();\n" in TEST_F()
463 format("void f() {\n" in TEST_F()
464 " \tf();\n" in TEST_F()
465 " \tg();\n" in TEST_F()
472 "void f() {\n" in TEST_F()
473 " if (a) {\n" in TEST_F()
474 " g();\n" in TEST_F()
475 " h();\n" in TEST_F()
476 "}\n" in TEST_F()
477 "\n" in TEST_F()
478 "void g() {\n" in TEST_F()
480 format("void f() {\n" in TEST_F()
481 " if (a) {\n" // Assume this was added without the closing brace. in TEST_F()
482 " g();\n" in TEST_F()
483 " h();\n" in TEST_F()
484 "}\n" in TEST_F()
485 "\n" in TEST_F()
486 "void g() {\n" // Make sure not to format this. in TEST_F()