Lines Matching refs:format
1 //===- unittest/Format/FormatTest.cpp - Formatting unit tests -------------===//
11 #include "clang/Format/Format.h"
15 #define DEBUG_TYPE "format-test"
18 namespace format {
31 std::string format(llvm::StringRef Code,
65 EXPECT_EQ(Code.str(), format(test::messUp(Code), Style));
71 format(test::messUp(Code), Style, IC_ExpectIncomplete));
83 /// \brief Verify that clang-format does not crash on the given input.
86 format(Code, Style, IC_DoNotCheck);
105 EXPECT_EQ(";", format(";"));
109 EXPECT_EQ("int i;", format(" int i;"));
110 EXPECT_EQ("\nint i;", format(" \n\t \v \f int i;"));
111 EXPECT_EQ("int i;\nint j;", format(" int i; int j;"));
112 EXPECT_EQ("int i;\nint j;", format(" int i;\n int j;"));
116 EXPECT_EQ("int i;", format("int\ni;"));
120 EXPECT_EQ("{\n {\n {}\n }\n}", format("{{{}}}"));
140 format("if(a){f();}"));
145 format("if (a) {\n"
152 format("/*\r\n"
162 format("class C {\n"
172 format("namespace N {\n"
181 format("extern /**/ \"C\" /**/ {\n"
194 format("extern \"C\" int f() {\n"
209 format("void f() {\n"
224 format("void f() {\n"
244 format("void f() {\n"
259 format("namespace {\n"
267 format("namespace {\n"
882 format("#include \\\n"
916 format("void f() { // This does something ..\n"
925 format("class C{void f() { // This does something ..\n"
932 format("int i;\\\n// single line trailing comment"));
953 format("D(a, {\n"
961 format("lineWith(); // comment\n"
967 format("lineWith(); // comment\n"
974 format("lineWith(); // comment\n"
980 format("lineWith();\n"
986 format("// first\n"
993 format("f();\n"
1005 format("f(); // comment\n"
1013 format("f(); // comment\n"
1021 format("void f() {\n"
1043 format("if( // This is some comment\n"
1058 format("SomeFunction(a,\n"
1064 format("SomeFunction(a,\n"
1070 format("SomeFunction(a, b, // comment (unclear relation)\n"
1075 format("SomeFunction(a, // comment\n"
1081 EXPECT_EQ("// comment", format("// comment "));
1083 format("int aaaaaaa, bbbbbbb; // comment ",
1085 EXPECT_EQ("// comment\\\n", format("// comment\\\n \t \v \f "));
1086 EXPECT_EQ("// comment \\\n", format("// comment \\\n \t \v \f "));
1094 format("f(aaaaaaaaaaaaaaaaaaaaaaaaa , \\\n"
1100 format("f(aaaaaaaaaaaaaaaaaaaaaaaaa , \n"
1107 format("void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
1132 format(" /*\n"
1144 format("class C {\n"
1156 format(" /*\n"
1164 format(" /*\n"
1171 format("int i; /* Comment with empty...\n"
1181 format("int foobar = 0; /* comment */\n"
1193 format("int foobar = 0; /* comment */\n"
1210 format("double *x; /* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
1222 format("void ffffffffffff(int aaaaaaaa, int bbbbbbbb, int cccccccccccc)\n"
1234 format("void ffffffffff(int aaaaa /* test */);",
1242 format("// A comment that doesn't fit on one line",
1247 format("/// A comment that doesn't fit on one line",
1252 format("//! A comment that doesn't fit on one line",
1257 format("// a b c d e f g h i j k", getLLVMStyleWithColumns(10)));
1262 format("\\\n// a b c d e f g h i j k", getLLVMStyleWithColumns(10)));
1266 format("if (true) // A comment that doesn't fit on one line ",
1269 format("// Don't_touch_leading_whitespace",
1273 format("//Add leading whitespace", getLLVMStyleWithColumns(20)));
1276 format("///Add leading whitespace", getLLVMStyleWithColumns(20)));
1279 format("//!Add leading whitespace", getLLVMStyleWithColumns(20)));
1280 EXPECT_EQ("// whitespace", format("//whitespace", getLLVMStyle()));
1283 format("//Even if it makes the line exceed the column limit",
1285 EXPECT_EQ("//--But not here", format("//--But not here", getLLVMStyle()));
1288 format("// aa bb cc dd ",
1295 format("// A comment before a macro definition\n"
1303 format("void ffffff(\n"
1309 format("//\t aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
1314 format("#define XXX // a b c d e f g h", getLLVMStyleWithColumns(22)));
1318 format("#define XXX //q w e r t y u i", getLLVMStyleWithColumns(22)));
1326 format("// A comment that doesn't fit on one line",
1332 format("/// A comment that doesn't fit on one line",
1340 format("// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\\n"
1346 format("int a; // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
1356 format("double a; // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
1367 format("// IWYU pragma: aaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbb", Pragmas));
1370 format("/* IWYU pragma: aaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbb */", Pragmas));
1378 format
1385 format("if (xxxxxxxxxx == yyy && // aaaaaa bbbbbbbb cccc\n"
1392 format("if (xxxxxxxxxx && yyy || // aaaaaa bbbbbbbb cccc\n"
1398 format("fffffffff(&xxx, // aaaaaaaaaaaa bbbbbbbbbbb\n"
1408 format("#define A(x) /* \\\n"
1418 format("#define A( \\\n"
1428 format("namespace {}\n // Test\n#define A"));
1430 format("namespace {}\n /* Test */\n#define A"));
1432 format("namespace {}\n /* Test */ #define A"));
1441 format("/* "
1452 format("/* a b c d e f g h i j k */", getLLVMStyleWithColumns(10)));
1458 format("\\\n/* a b c d e f g h i j k */", getLLVMStyleWithColumns(10)));
1464 format("/*\n"
1476 format("/* \n"
1488 format("/*\n"
1497 format("/*\n"
1509 format("{\n"
1527 format("{\n"
1543 format(" /*\n"
1553 format("{\n"
1563 format("/* A comment before a macro definition */\n"
1574 format(" /* some comment\n"
1586 format("/**\n"
1596 format(" /* \n"
1602 format("/* a a */", getLLVMStyleWithColumns(15)));
1604 format("/* a a bc */", getLLVMStyleWithColumns(15)));
1607 format("/* aaa aaa aaaaa */", getLLVMStyleWithColumns(15)));
1610 format("/* aaa aaa aaaaa */", getLLVMStyleWithColumns(15)));
1622 format("#define X \\\n"
1634 format("#define X \\\n"
1644 format("#define X \\\n"
1657 format("static SomeType type = { aaaaaaaaaaaaaaaaaaaa , /* comment */\n"
1690 format("S s = {\n"
1703 format("S s = {\n"
1721 format("#if 0\n"
1729 format("#if false\n"
1742 format("enum E {\n"
1760 format("enum F {\n"
1780 format("enum G {\n"
1800 format("enum H {\n"
1819 format("enum I {\n"
1839 format("enum J {\n"
1913 format("class A {\n"
1927 format("class A {\n"
1942 format("#define B \\\n"
1955 format("#define A private:\n"
2038 format("enum KeepEmptyLines {\n"
2205 format("#ifndef HEADER_GUARD\n"
2215 format("namespace A::B {\n"
2227 format("namespace out {\n"
2242 format("namespace out {\n"
2270 format("void NS_InvokeByIndex(void *that, unsigned int methodIndex) {\n"
2281 format("_asm {\n"
2292 format("__asm {\n"
2471 format("S s = {\n"
2583 format("#define Q \"/aaaaaaaaa/aaaaaaaaaaaaaaaaaaa/aaaaaaaa.cpp\"",
2589 format(" # 123 \"A string literal\""));
2593 EXPECT_EQ("#;", format("#;"));
2599 format("# \\\n line \\\n 42 \\\n \"test\"\n"));
2600 EXPECT_EQ("#define A B\n", format("# \\\n define \\\n A \\\n B\n",
2606 format("# \\\n line \\\n 42 \\\n \"test\""));
2607 EXPECT_EQ("#define A B", format("# \\\n define \\\n A \\\n B"));
2613 EXPECT_EQ("#define A \\ x20", format("#define A \\ x20"));
2620 format("const char * c = STRINGIFY(\n"
2649 format(" // somecomment\n"
2658 TEST_F(FormatTest, LayoutSingleHash) { EXPECT_EQ("#\na;", format("#\na;")); }
2665 format("#define A c; e;\n"
2670 TEST_F(FormatTest, LayoutRemainingTokens) { EXPECT_EQ("{}", format("{}")); }
2676 format("int x,\n#define A\ny;"));
2680 EXPECT_EQ("#define A(c) L#c", format("#define A(c) L#c", getLLVMStyle()));
2700 EXPECT_EQ("#define A (x)", format("#define A (x)"));
2701 EXPECT_EQ("#define A(x)", format("#define A(x)"));
2705 EXPECT_EQ("#define A b;", format("#define A \\\n"
2713 format("#define A \\\n"
2722 format("#define A \\\n"
2769 format("class A : public QObject {\n"
2776 format("MACRO\n"
2782 format("SOME_MACRO\n"
2787 EXPECT_EQ("HTTP f();", format("HTTP\nf();"));
2788 EXPECT_EQ("MACRO\nf();", format("MACRO\nf();"));
2793 format("class A : public QObject {\n"
2800 format("SOME_WEIRD_LOG_MACRO\n"
2815 format(" INITIALIZE_PASS_BEGIN(ScopDetection, \"polly-detect\")\n"
2828 format("int q() {\n"
2839 format("#define LIST(L) \\\n"
2867 format("int q() {\n"
2903 format("int q() {\n"
2921 format("class A {\n"
2931 format("class SomeClass {\n"
2941 format("class SomeClass {\n"
2960 EXPECT_EQ("{\n {\n#define A\n }\n}", format("{{\n#define A\n}}"));
2969 format("#define A { {\nint i;", getLLVMStyleWithColumns(11)));
2971 format("#define A } }\nint i;", getLLVMStyleWithColumns(11)));
2977 format("#define A \\\nint i;\\\n int j;", getLLVMStyleWithColumns(11)));
2978 EXPECT_EQ("#define A\n\nint i;", format("#define A \\\n\n int i;"));
2979 EXPECT_EQ("template <class T> f();", format("\\\ntemplate <class T> f();"));
2980 EXPECT_EQ("/* \\ \\ \\\n*/", format("\\\n/* \\ \\ \\\n*/"));
2981 EXPECT_EQ("<a\n\\\\\n>", format("<a\n\\\\\n>"));
2990 format("int xxxxxxxxx; /* "
3011 format(" #define ALooooooooooooooooooooooooooooooooooooooongMacro("
3023 format("int\n#define A\na;"));
3162 format(" SOME_MACRO {int i;} int i;"));
3194 format("call(parameter, {\n"
3200 EXPECT_EQ("DEBUG({ int i; });", format("DEBUG({ int i; });"));
3204 format("DEBUG({ // comment\n"
3213 format("DEBUG({\n"
3248 format("#define MACRO() Debug(aaa, /* force line break */ \\\n"
3257 format("#define A [] { xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx( \\\n"
3263 EXPECT_EQ("{}", format("{}"));
3645 format("Constructor() :\n"
4034 format("f(g(h(a, // comment\n"
4133 format("aaa(aaaa,\n" // one-per-line
4142 format("aaa(aaaa, aaaa,\n" // bin-packed
4475 " format(TheLine.First, IndentForLevel[TheLine.Level] >= 0\n"
4618 " format(TheLine.First, IndentForLevel[TheLine.Level] >= 0 ?\n"
4688 format("fun + \"1243\" /* comment */\n"
4695 format("aaaaaa ="
4922 format("x = \"a\\\n"
4930 format("xxxx = \"a\\\n"
4938 format("NSString *const kString = @\"aaaa\"\n"
5040 format("llvm::errs() << \"\n<<a;"));
5224 format("static_cast<A<//\n"
5304 EXPECT_EQ("A<A<A<A>>> a;", format("A<A<A<A> >> a;", getGoogleStyle()));
5305 EXPECT_EQ("A<A<A<A>>> a;", format("A<A<A<A>> > a;", getGoogleStyle()));
5306 EXPECT_EQ("A<::A<int>> a;", format("A< ::A<int>> a;", getGoogleStyle()));
5307 EXPECT_EQ("A<::A<int>> a;", format("A<::A<int> > a;", getGoogleStyle()));
5309 format("auto x=[]{A<A<A<A> >> a;};", getGoogleStyle()));
5705 format("#define OP(x) \\\n"
5765 format("int *a;\n"
5772 format("int* a;\n"
5779 format("int *a;\n"
5788 format("auto x=[]{int *a;\n"
6086 EXPECT_EQ("#include \"a.h\"", format("#include \"a.h\""));
6087 EXPECT_EQ("#include <a>", format("#include<a>"));
6147 EXPECT_EQ("void f() { return }", format("void f ( ) { return }"));
6152 format("void f ( ) { if ( a ) return }"));
6156 format("namespace N { void f() }"));
6161 format("namespace N { void f( ) { } void g( ) }"));
6224 EXPECT_EQ("{\n {}\n", format("{\n{\n}\n"));
6225 EXPECT_EQ("{\n {}\n", format("{\n {\n}\n"));
6226 EXPECT_EQ("{\n {}\n", format("{\n {\n }\n"));
6227 EXPECT_EQ("{\n {}\n}\n}\n", format("{\n {\n }\n }\n}\n"));
6234 format("{\n"
6349 format("function({\n"
6359 format("std::vector<int> MyNumbers{// First element:\n"
6369 format("vector<int> SomeVector = { // aaa\n"
6512 // With nested lists, we should either format one item per line or all nested
6592 EXPECT_EQ("A() : b(0) {}", format("A():b(0){}", NoColumnLimit));
6596 format("class C{A():b(0){}};", NoColumnLimit));
6600 format("A()\n:b(0)\n{\n}", NoColumnLimit));
6608 format("A():b(0){}", DoNotMergeNoColumnLimit));
6612 format("A()\n:b(0)\n{\n}", DoNotMergeNoColumnLimit));
6709 format("#error Leave all white!!!!! space* alone!\n"));
6712 format("#warning Leave all white!!!!! space* alone!\n"));
6713 EXPECT_EQ("#error 1", format(" # error 1"));
6714 EXPECT_EQ("#warning 1", format(" # warning 1"));
6738 format("if (true)\nreturn 42;", AllowsMergedIf));
6798 format("/* *//* */ /* */\n/* *//* */ /* */"));
6799 EXPECT_EQ("/* */ a /* */ b;", format(" /* */ a/* */ b;"));
6805 format("#define A /*123*/ b\n"
6813 format("#define A\n"
6816 EXPECT_EQ("/*\n**\n*/", format("/*\n**\n*/"));
6822 format("/*\n"
6832 format("/*\n"
6845 format("someFunction (1, /* comment 1 */\n"
6857 format(
6865 format("int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; /* comment */\n"
6874 format("/*\n"
6880 format("/*\n"
6886 format("/*\n"
6891 format("/*\n"
6895 format("/*\n"
6904 format("#define A { \\\n"
6913 format("#define A { \\\n"
6924 format("a = {1111 /* */\n"
6930 format("a = {1111 /* */\n"
6939 format("a = {1111 /* a */\n"
6978 format("-(NSUInteger)indexOfObject:(id)anObject;"));
6979 EXPECT_EQ("- (NSInteger)Mthod1;", format("-(NSInteger)Mthod1;"));
6980 EXPECT_EQ("+ (id)Mthod2;", format("+(id)Mthod2;"));
6982 format("-(NSInteger)Method3:(id)anObject;"));
6984 format("-(NSInteger)Method4:(id)anObject;"));
6986 format("-(NSInteger)Method5:(id)anObject:(id)AnotherObject;"));
6988 format("- (id)Method6:(id)A:(id)B:(id)C:(id)D;"));
6991 format("- (void)sendAction:(SEL)aSelector to:(id)anObject "
7204 format("@implementation Foo : Bar\n"
7533 EXPECT_EQ("@interface", format("@ interface"));
7719 format("\"some text other\";", getLLVMStyleWithColumns(12)));
7722 format("\\\n\"some text other\";", getLLVMStyleWithColumns(12)));
7728 format("#define A \"some text other\";", getLLVMStyleWithColumns(12)));
7734 format("#define A \"so text other\";", getLLVMStyleWithColumns(12)));
7737 format("\"some text\"", getLLVMStyleWithColumns(1)));
7739 format("\"some text\"", getLLVMStyleWithColumns(11)));
7742 format("\"some text\"", getLLVMStyleWithColumns(10)));
7745 format("\"some text\"", getLLVMStyleWithColumns(7)));
7749 format("\"some text\"", getLLVMStyleWithColumns(6)));
7753 format("\"some tex and\"", getLLVMStyleWithColumns(6)));
7757 format("\"some/tex/and\"", getLLVMStyleWithColumns(6)));
7762 format("variable = \"long string literal\";",
7770 format("variable = f(\"long string literal\", short, "
7778 format("f(g(\"long string literal\"), b);", getLLVMStyleWithColumns(20)));
7783 format("f(g(\"long string literal\", a), b);",
7788 format("f(\"one two\".split(variable));", getLLVMStyleWithColumns(20)));
7792 format("f(\"one two three four five six seven\"."
7799 format("f(\"some text\", other);", getLLVMStyleWithColumns(10)));
7810 format("\"splitmeatrandompoint\"", getLLVMStyleWithColumns(10)));
7815 format("\"split/pathat/slashes\"", getLLVMStyleWithColumns(10)));
7820 format("\"split/pathat/slashes\"", getLLVMStyleWithColumns(10)));
7827 format("\"split at "
7842 format("aaaaaaaaaaaa(\"aaaaaaaaaaaaaaaaaaaaaaaaaa "
7848 format("return \"aaaaaaaaaaaaaaaaaaaaaa "
7854 format("llvm::outs() << "
7860 format("ffff({\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa "
7870 format("#define A \"some text other\";", AlignLeft));
7877 format("int i=a(\n\n b(\n\n\n )\n\n);", NoEmptyLines));
7885 format("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
7894 format("u8\"utf8 string literal\";", getGoogleStyleWithColumns(16)));
7898 format("u\"utf16 string literal\";", getGoogleStyleWithColumns(16)));
7902 format("U\"utf32 string literal\";", getGoogleStyleWithColumns(16)));
7905 format("L\"wide string literal\";", getGoogleStyleWithColumns(16)));
7908 format("@\"NSString literal\";", getGoogleStyleWithColumns(19)));
7910 // This input makes clang-format try to split the incomplete unicode escape
7919 EXPECT_EQ("R\"x(raw literal)x\";", format("R\"x(raw literal)x\";", Style));
7920 EXPECT_EQ("uR\"x(raw literal)x\";", format("uR\"x(raw literal)x\";", Style));
7921 EXPECT_EQ("LR\"x(raw literal)x\";", format("LR\"x(raw literal)x\";", Style));
7922 EXPECT_EQ("UR\"x(raw literal)x\";", format("UR\"x(raw literal)x\";", Style));
7924 format("u8R\"x(raw literal)x\";", Style));
7933 format(" _T(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\")", Style));
7937 format("f(x, _T(\"aaaaaaaaaaaaaaa\"), z);", Style));
7944 // format(" _T ( \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" )",
7948 format(" _T ( \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" )", Style));
7954 format("f(\n"
7962 format("f(\n"
7972 format("aaaaaaaaaaa = \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\\n"
7979 format("f(g(R\"x(raw literal)x\", a), b);", getGoogleStyle()));
7985 format("fffffffffff(g(R\"x(\n"
7995 format("fffffffffff(g(R\"x(qqq\n"
8003 format("fffffffffff(R\"x(\n"
8010 format("fffffffffff(R\"x(\n"
8019 format("fffffffffff(\n"
8030 format("function( \"unterminated,\n"
8038 format("#define x(_a) printf(\"foo\"_a);", Style));
8046 format("someFunction(\"aaabbbcccdddeeefff\");",
8050 format("someFunction1234567890(\"aaabbbcccdddeeefff\");",
8055 format("someFunction1234567890(\"aaabbbcccdddeeefff\");",
8060 format("someFunction1234567890(\"aaabbbcccdddeeefff\");",
8065 format("someFunction(\"aaabbbcc ddde efff\");",
8069 format("someFunction(\"aaabbbccc ddeeefff\");",
8074 format("someFunction1234567890(\"aaabb cccdddeeefff\");",
8081 format("#define A string s = \"1234567890\"; int i;",
8087 format("someFunction(\"aaabbbcc dddeeefff\");",
8092 EXPECT_EQ("\"\\a\"", format("\"\\a\"", getLLVMStyleWithColumns(3)));
8093 EXPECT_EQ("\"\\\"", format("\"\\\"", getLLVMStyleWithColumns(2)));
8096 format("\"test\\n\"", getLLVMStyleWithColumns(7)));
8099 format("\"tes\\\\n\"", getLLVMStyleWithColumns(7)));
8102 format("\"\\\\\\\\\\n\"", getLLVMStyleWithColumns(7)));
8103 EXPECT_EQ("\"\\uff01\"", format("\"\\uff01\"", getLLVMStyleWithColumns(7)));
8106 format("\"\\uff01test\"", getLLVMStyleWithColumns(8)));
8108 format("\"\\Uff01ff02\"", getLLVMStyleWithColumns(11)));
8111 format("\"\\x000000000001next\"", getLLVMStyleWithColumns(16)));
8113 format("\"\\x000000000001next\"", getLLVMStyleWithColumns(15)));
8115 format("\"\\x000000000001\"", getLLVMStyleWithColumns(7)));
8119 format("\"test\\000000000001\"", getLLVMStyleWithColumns(9)));
8123 format("\"test\\000000000001\"", getLLVMStyleWithColumns(10)));
8185 format("if (aaaaaaaa &&// q\n"
8191 format("if(aaa&&bbb)// w\n"
8246 format(" /*\t \t \n"
8271 format("if (aaaaaaaa &&// q\n"
8296 format("{\n"
8307 format("{\n"
8317 format("{\n"
8327 format("{\n"
8338 format("{\n"
8349 format("{\n"
8361 format(" /*\t \t \n"
8368 format(" \t \t /* some\n"
8373 format(" \t \t int a; /* some\n"
8379 format(" \t \t int\ta; /* some\n"
8384 format(" \t \t f(\"\t\t\"); /* some\n"
8393 format("{\n"
8405 format(" \"qqqqqqqqqqqqqqqqqqqqqqqqqq\\\n"
8412 format("// qqqqqqqqqqqqqqqqqqqqqqqqqq\n"
8420 format("// qqqqqqqqqqqqqqqqqqqqqqqqqq\\\n"
8428 format(" inttt qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq\\\n"
8712 format("int a = 5;\n"
8720 format("int a = 5;\n"
8730 format("int a = 5;\n"
8874 format("float const a = 5;\n"
8882 format("float a = 5;\n"
8892 format("float a = 5;\n"
8919 format("void SomeFunction(int parameter= 0) {\n"
9584 format("#pragma mark Any non-hyphenated or hyphenated string "
9591 EXPECT_EQ("#pragma option -C -A", format("#pragma option -C -A"));
10082 format("\"\xce\xe4\xed\xe0\xe6\xe4\xfb \xe2 "
10089 EXPECT_EQ("\xef\xbb\xbf", format("\xef\xbb\xbf"));
10091 format("\xef\xbb\xbf#include <iostream>"));
10093 format("\xef\xbb\xbf\n#include <iostream>"));
10120 format("\"aaaaÄ\xc2\x8d\";", getLLVMStyleWithColumns(10)));
10123 format("\"aaaaaaaÄ\xc2\x8d\";", getLLVMStyleWithColumns(10)));
10128 format("\"???????, ? ???????? ?????? ????,\"",
10135 format("\"? ? ? ? ?? ? ? ? ?\"", getLLVMStyleWithColumns(11)));
10141 format("\"?\t? \t? ? ?\t? \t? ???\tqq\"",
10147 format("\"aaaaaa\\\xC2\x8D\"", getLLVMStyleWithColumns(10)));
10154 format("const char *sssss = \"????????\\\n"
10161 format("// aaaaÄ\xc2\x8d", getLLVMStyleWithColumns(10)));
10166 format("// ? ?? ???? ?????; ??? ??????? ?????.",
10172 format("// ??? ???? ? ? ?", getLLVMStyleWithColumns(9)));
10184 format("/* ?????, ??????????? ???????? ? ????\n"
10192 format("/* ??? ???? ? ? ? */", getLLVMStyleWithColumns(9)));
10196 format("/* ???? ???? ???? ???-? */", getLLVMStyleWithColumns(12)));
10339 format("void f() {\n"
10369 format("SomeClass::Constructor():a(a){}", Style));
10400 format("ASSERT ( aaaa\n||bbbb);", Style));
10407 format("if (aaaaaaaaaaaaaaa\n"
10413 format("if (aaaaaaaaaaaaaaa || bbbbbbbbbbbbbbb) { i++; }", Style));
10420 format("#define aNumber \\\n"
10427 format("NSArray*a=[[NSArray alloc] initWithArray:@[]\n"
10432 format("NSArray*a=[[NSArray alloc]initWithArray:@[ @\"a\" ]\n"
10442 format("NSArray* a = [[NSArray alloc] initWithArray:@[\n"
10451 format("NSArray* a = [[NSArray alloc] initWithArray:@[ @\"a\", @\"a\" ]\n"
10458 format("[self.a b:c\n"
10485 format("SomeFunction([](){\n"
10720 format("[[SessionService sharedService]\n"
10758 format("void (^largeBlock)(void) = ^{ int i; };", ZeroColumn));
10763 format("void (^largeBlock)(void) = ^{ int i; };", ZeroColumn));
10770 format("int a;\r\n"
10777 format("int a;\r\n"
10784 format("int a;\r\n"
10790 format("\"aaaaaaa bbbbbbb\";\r\n", getLLVMStyleWithColumns(10)));
10795 format("#define A \\\r\n"
10805 format("/*\r\n"
10826 format("int i = longFunction(arg);", TwoIndent));
10834 format("int i = longFunction(arg);", SixIndent));
10869 EXPECT_EQ("f<<<1, 1>>>();", format("f <<< 1, 1 >>> ();"));
10872 EXPECT_EQ("f<param><<<1, 1>>>();", format("f< param > <<< 1, 1 >>> ();"));
10879 EXPECT_EQ("< < <", format("\\\n<<<"));
10897 EXPECT_EQ(code, format(code));
10914 format("int a;\n"
10939 format("void f() {\n"
10954 format("<<<<<<<\n"
10964 format("<<<<<<<\n"
10980 format("#define Macro \\\n"
10994 "// clang-format off\n"
10996 "// clang-format on\n"
10998 format(" int i;\n"
10999 " // clang-format off\n"
11001 " // clang-format on\n"
11004 "/* clang-format off */\n"
11006 "/* clang-format on */\n"
11008 format(" int i;\n"
11009 " /* clang-format off */\n"
11011 " /* clang-format on */\n"
11016 format("? ) =");
11021 } // end namespace format