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()
165 EXPECT_EQ("int x; // Format this line.\n" in TEST_F()
166 "int xx; //\n" in TEST_F()
168 format("int x; // Format this line.\n" in TEST_F()
169 "int xx; //\n" in TEST_F()
175 EXPECT_EQ("DEBUG({\n" in TEST_F()
176 " int i;\n" in TEST_F()
177 " int j;\n" in TEST_F()
179 format("DEBUG( {\n" in TEST_F()
180 " int i;\n" in TEST_F()
181 " int j;\n" in TEST_F()
184 EXPECT_EQ("DEBUG( {\n" in TEST_F()
185 " int i;\n" in TEST_F()
186 " int j;\n" in TEST_F()
188 format("DEBUG( {\n" in TEST_F()
189 " int i;\n" in TEST_F()
190 " int j;\n" in TEST_F()
193 EXPECT_EQ("DEBUG( {\n" in TEST_F()
194 " int i;\n" in TEST_F()
195 " int j;\n" in TEST_F()
197 format("DEBUG( {\n" in TEST_F()
198 " int i;\n" in TEST_F()
199 " int j;\n" in TEST_F()
202 EXPECT_EQ("DEBUG({\n" in TEST_F()
203 " int i;\n" in TEST_F()
204 " int j;\n" in TEST_F()
206 format("DEBUG( {\n" in TEST_F()
207 " int i;\n" in TEST_F()
208 " int j;\n" in TEST_F()
212 EXPECT_EQ("Debug({\n" in TEST_F()
213 " if (aaaaaaaaaaaaaaaaaaaaaaaa)\n" in TEST_F()
214 " return;\n" in TEST_F()
215 " },\n" in TEST_F()
217 format("Debug({\n" in TEST_F()
218 " if (aaaaaaaaaaaaaaaaaaaaaaaa)\n" in TEST_F()
219 " return;\n" in TEST_F()
220 " },\n" in TEST_F()
223 EXPECT_EQ("DEBUG({\n" in TEST_F()
224 " DEBUG({\n" in TEST_F()
225 " int a;\n" in TEST_F()
226 " int b;\n" in TEST_F()
227 " }) ;\n" in TEST_F()
229 format("DEBUG({\n" in TEST_F()
230 " DEBUG({\n" in TEST_F()
231 " int a;\n" in TEST_F()
232 " int b;\n" // Format this line only. in TEST_F()
233 " }) ;\n" // Don't touch this line. in TEST_F()
236 EXPECT_EQ("DEBUG({\n" in TEST_F()
237 " int a; //\n" in TEST_F()
239 format("DEBUG({\n" in TEST_F()
240 " int a; //\n" in TEST_F()
243 EXPECT_EQ("someFunction(\n" in TEST_F()
244 " [] {\n" in TEST_F()
245 " // Only with this comment.\n" in TEST_F()
246 " int i; // invoke formatting here.\n" in TEST_F()
247 " }, // force line break\n" in TEST_F()
249 format("someFunction(\n" in TEST_F()
250 " [] {\n" in TEST_F()
251 " // Only with this comment.\n" in TEST_F()
252 " int i; // invoke formatting here.\n" in TEST_F()
253 " }, // force line break\n" in TEST_F()
257 EXPECT_EQ("int longlongname; // comment\n" in TEST_F()
258 "int x = f({\n" in TEST_F()
259 " int x; // comment\n" in TEST_F()
260 " int y; // comment\n" in TEST_F()
262 format("int longlongname; // comment\n" in TEST_F()
263 "int x = f({\n" in TEST_F()
264 " int x; // comment\n" in TEST_F()
265 " int y; // comment\n" in TEST_F()
268 EXPECT_EQ("int s = f({\n" in TEST_F()
269 " class X {\n" in TEST_F()
270 " public:\n" in TEST_F()
271 " void f();\n" in TEST_F()
272 " };\n" in TEST_F()
274 format("int s = f({\n" in TEST_F()
275 " class X {\n" in TEST_F()
276 " public:\n" in TEST_F()
277 " void f();\n" in TEST_F()
278 " };\n" in TEST_F()
281 EXPECT_EQ("SomeFunction(\n" in TEST_F()
282 " [] {\n" in TEST_F()
283 " int i;\n" in TEST_F()
284 " return i;\n" // Format this line. in TEST_F()
285 " },\n" in TEST_F()
286 " [] {\n" in TEST_F()
287 " return 2;\n" // Don't fix this. in TEST_F()
289 format("SomeFunction(\n" in TEST_F()
290 " [] {\n" in TEST_F()
291 " int i;\n" in TEST_F()
292 " return i;\n" // Format this line. in TEST_F()
293 " },\n" in TEST_F()
294 " [] {\n" in TEST_F()
295 " return 2;\n" // Don't fix this. in TEST_F()
301 EXPECT_EQ("namespace {\n" in TEST_F()
302 "int i;\n" in TEST_F()
303 "int j;\n" in TEST_F()
305 format("namespace {\n" in TEST_F()
306 " int i;\n" // Format here. in TEST_F()
307 " int j;\n" in TEST_F()
310 EXPECT_EQ("namespace {\n" in TEST_F()
311 " int i;\n" in TEST_F()
312 " int j;\n" in TEST_F()
314 format("namespace {\n" in TEST_F()
315 " int i;\n" in TEST_F()
316 " int j;\n" // Format here. in TEST_F()
323 EXPECT_EQ("int i;\n" in TEST_F()
324 "#define A \\\n" in TEST_F()
325 " int i; \\\n" in TEST_F()
326 " int j\n" in TEST_F()
328 format("int i;\n" in TEST_F()
329 "#define A \\\n" in TEST_F()
330 " int i ; \\\n" in TEST_F()
331 " int j\n" in TEST_F()
334 EXPECT_EQ("int i;\n" in TEST_F()
335 "#define A \\\n" in TEST_F()
336 " int i; \\\n" in TEST_F()
337 " int j\n" in TEST_F()
339 format("int i;\n" in TEST_F()
340 "#define A \\\n" in TEST_F()
341 " int i ; \\\n" in TEST_F()
342 " int j\n" in TEST_F()
348 EXPECT_EQ("{\n" in TEST_F()
349 "{\n" in TEST_F()
350 "a;\n" in TEST_F()
351 "b;\n" in TEST_F()
352 "}\n" in TEST_F()
354 format("{\n" in TEST_F()
355 "{\n" in TEST_F()
356 "a;\n" in TEST_F()
357 " b;\n" in TEST_F()
358 "}\n" in TEST_F()
361 EXPECT_EQ("{\n" in TEST_F()
362 "{\n" in TEST_F()
363 " a;\n" in TEST_F()
364 " b;\n" in TEST_F()
365 " c;\n" in TEST_F()
366 " d;\n" in TEST_F()
367 "}\n" in TEST_F()
369 format("{\n" in TEST_F()
370 "{\n" in TEST_F()
371 " a;\n" in TEST_F()
372 " b;\n" in TEST_F()
373 " c;\n" in TEST_F()
374 " d;\n" in TEST_F()
375 "}\n" in TEST_F()
378 EXPECT_EQ("{\n" in TEST_F()
379 "{\n" in TEST_F()
380 "public:\n" in TEST_F()
381 " b;\n" in TEST_F()
382 "}\n" in TEST_F()
384 format("{\n" in TEST_F()
385 "{\n" in TEST_F()
386 "public:\n" in TEST_F()
387 " b;\n" in TEST_F()
388 "}\n" in TEST_F()
391 EXPECT_EQ("{\n" in TEST_F()
392 "{\n" in TEST_F()
393 "a;\n" in TEST_F()
394 "}\n" in TEST_F()
395 "{\n" in TEST_F()
396 " b; //\n" in TEST_F()
397 "}\n" in TEST_F()
399 format("{\n" in TEST_F()
400 "{\n" in TEST_F()
401 "a;\n" in TEST_F()
402 "}\n" in TEST_F()
403 "{\n" in TEST_F()
404 " b; //\n" in TEST_F()
405 "}\n" in TEST_F()
408 EXPECT_EQ(" {\n" in TEST_F()
409 " a; //\n" in TEST_F()
411 format(" {\n" in TEST_F()
412 "a; //\n" in TEST_F()
415 EXPECT_EQ("void f() {}\n" in TEST_F()
417 format("void f() {}\n" in TEST_F()
420 EXPECT_EQ("int a; // comment\n" in TEST_F()
421 " // line 2\n" in TEST_F()
423 format("int a; // comment\n" in TEST_F()
424 " // line 2\n" in TEST_F()
428 EXPECT_EQ(" void f() {\n" in TEST_F()
429 "#define A 1\n" in TEST_F()
431 format(" void f() {\n" in TEST_F()
432 " #define A 1\n" // Format this line. in TEST_F()
435 EXPECT_EQ(" void f() {\n" in TEST_F()
436 " int i;\n" in TEST_F()
437 "#define A \\\n" in TEST_F()
438 " int i; \\\n" in TEST_F()
439 " int j;\n" in TEST_F()
440 " int k;\n" in TEST_F()
442 format(" void f() {\n" in TEST_F()
443 " int i;\n" in TEST_F()
444 "#define A \\\n" in TEST_F()
445 " int i; \\\n" in TEST_F()
446 " int j;\n" in TEST_F()
447 " int k;\n" // Format this line. in TEST_F()
452 EXPECT_EQ(" int a;\n" in TEST_F()
453 " void\n" in TEST_F()
454 " ffffff() {\n" in TEST_F()
456 format(" int a;\n" in TEST_F()
465 EXPECT_EQ("void f() {\n" in TEST_F()
466 "\tf();\n" in TEST_F()
467 "\tg();\n" in TEST_F()
469 format("void f() {\n" in TEST_F()
470 "\tf();\n" in TEST_F()
471 "\tg();\n" in TEST_F()
474 EXPECT_EQ("void f() {\n" in TEST_F()
475 "\tf();\n" in TEST_F()
476 "\tg();\n" in TEST_F()
478 format("void f() {\n" in TEST_F()
479 "\tf();\n" in TEST_F()
480 "\tg();\n" in TEST_F()
483 EXPECT_EQ("void f() {\n" in TEST_F()
484 " \tf();\n" in TEST_F()
485 "\tg();\n" in TEST_F()
487 format("void f() {\n" in TEST_F()
488 " \tf();\n" in TEST_F()
489 " \tg();\n" in TEST_F()
496 "void f() {\n" in TEST_F()
497 " if (a) {\n" in TEST_F()
498 " g();\n" in TEST_F()
499 " h();\n" in TEST_F()
500 "}\n" in TEST_F()
501 "\n" in TEST_F()
502 "void g() {\n" in TEST_F()
504 format("void f() {\n" in TEST_F()
505 " if (a) {\n" // Assume this was added without the closing brace. in TEST_F()
506 " g();\n" in TEST_F()
507 " h();\n" in TEST_F()
508 "}\n" in TEST_F()
509 "\n" in TEST_F()
510 "void g() {\n" // Make sure not to format this. in TEST_F()
518 "var x = \"a\";\n" in TEST_F()
519 "var x = 'a';\n" in TEST_F()
521 format("var x = \"a\";\n" in TEST_F()
522 "var x = \"a\";\n" in TEST_F()