@@ -828,26 +828,20 @@ TEST_F(FormatTestJS, AsyncFunctions) {
828828 " } " );
829829 // clang-format must not insert breaks between async and function, otherwise
830830 // automatic semicolon insertion may trigger (in particular in a class body).
831- auto Style = getGoogleJSStyleWithColumns (10 );
832831 verifyFormat (" async function\n "
833832 " hello(\n "
834833 " myparamnameiswaytooloooong) {\n "
835834 " }" ,
836835 " async function hello(myparamnameiswaytooloooong) {}" ,
837- Style);
838- verifyFormat (" async function\n "
839- " union(\n "
840- " myparamnameiswaytooloooong) {\n "
841- " }" ,
842- Style);
836+ getGoogleJSStyleWithColumns (10 ));
843837 verifyFormat (" class C {\n "
844838 " async hello(\n "
845839 " myparamnameiswaytooloooong) {\n "
846840 " }\n "
847841 " }" ,
848842 " class C {\n "
849843 " async hello(myparamnameiswaytooloooong) {} }" ,
850- Style );
844+ getGoogleJSStyleWithColumns ( 10 ) );
851845 verifyFormat (" async function* f() {\n "
852846 " yield fetch(x);\n "
853847 " }" );
@@ -1344,16 +1338,15 @@ TEST_F(FormatTestJS, WrapRespectsAutomaticSemicolonInsertion) {
13441338 // The following statements must not wrap, as otherwise the program meaning
13451339 // would change due to automatic semicolon insertion.
13461340 // See http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1.
1347- auto Style =getGoogleJSStyleWithColumns (10 );
1348- verifyFormat (" return aaaaa;" , Style);
1349- verifyFormat (" yield aaaaa;" , Style);
1350- verifyFormat (" return /* hello! */ aaaaa;" , Style);
1351- verifyFormat (" continue aaaaa;" , Style);
1352- verifyFormat (" continue /* hello! */ aaaaa;" , Style);
1353- verifyFormat (" break aaaaa;" , Style);
1354- verifyFormat (" throw aaaaa;" , Style);
1355- verifyFormat (" aaaaaaaaa++;" , Style);
1356- verifyFormat (" aaaaaaaaa--;" , Style);
1341+ verifyFormat (" return aaaaa;" , getGoogleJSStyleWithColumns (10 ));
1342+ verifyFormat (" yield aaaaa;" , getGoogleJSStyleWithColumns (10 ));
1343+ verifyFormat (" return /* hello! */ aaaaa;" , getGoogleJSStyleWithColumns (10 ));
1344+ verifyFormat (" continue aaaaa;" , getGoogleJSStyleWithColumns (10 ));
1345+ verifyFormat (" continue /* hello! */ aaaaa;" , getGoogleJSStyleWithColumns (10 ));
1346+ verifyFormat (" break aaaaa;" , getGoogleJSStyleWithColumns (10 ));
1347+ verifyFormat (" throw aaaaa;" , getGoogleJSStyleWithColumns (10 ));
1348+ verifyFormat (" aaaaaaaaa++;" , getGoogleJSStyleWithColumns (10 ));
1349+ verifyFormat (" aaaaaaaaa--;" , getGoogleJSStyleWithColumns (10 ));
13571350 verifyFormat (" return [\n "
13581351 " aaa\n "
13591352 " ];" ,
@@ -1373,13 +1366,12 @@ TEST_F(FormatTestJS, WrapRespectsAutomaticSemicolonInsertion) {
13731366 // Ideally the foo() bit should be indented relative to the async function().
13741367 verifyFormat (" async function\n "
13751368 " foo() {}" ,
1376- Style);
1377- verifyFormat (" await theReckoning;" , Style);
1378- verifyFormat (" some['a']['b']" , Style);
1379- verifyFormat (" union['a']['b']" , Style);
1369+ getGoogleJSStyleWithColumns (10 ));
1370+ verifyFormat (" await theReckoning;" , getGoogleJSStyleWithColumns (10 ));
1371+ verifyFormat (" some['a']['b']" , getGoogleJSStyleWithColumns (10 ));
13801372 verifyFormat (" x = (a['a']\n "
13811373 " ['b']);" ,
1382- Style );
1374+ getGoogleJSStyleWithColumns ( 10 ) );
13831375 verifyFormat (" function f() {\n "
13841376 " return foo.bar(\n "
13851377 " (param): param is {\n "
@@ -2508,10 +2500,6 @@ TEST_F(FormatTestJS, NonNullAssertionOperator) {
25082500TEST_F (FormatTestJS, CppKeywords) {
25092501 // Make sure we don't mess stuff up because of C++ keywords.
25102502 verifyFormat (" return operator && (aa);" );
2511- verifyFormat (" enum operator {\n "
2512- " A = 1,\n "
2513- " B\n "
2514- " }" );
25152503 // .. or QT ones.
25162504 verifyFormat (" const slots: Slot[];" );
25172505 // use the "!" assertion operator to validate that clang-format understands
0 commit comments