@@ -828,26 +828,20 @@ TEST_F(FormatTestJS, AsyncFunctions) {
828
828
" } " );
829
829
// clang-format must not insert breaks between async and function, otherwise
830
830
// automatic semicolon insertion may trigger (in particular in a class body).
831
- auto Style = getGoogleJSStyleWithColumns (10 );
832
831
verifyFormat (" async function\n "
833
832
" hello(\n "
834
833
" myparamnameiswaytooloooong) {\n "
835
834
" }" ,
836
835
" async function hello(myparamnameiswaytooloooong) {}" ,
837
- Style );
838
- verifyFormat (" async function\n "
839
- " union(\n "
840
- " myparamnameiswaytooloooong) {\n "
841
- " }" ,
842
- Style );
836
+ getGoogleJSStyleWithColumns (10 ));
843
837
verifyFormat (" class C {\n "
844
838
" async hello(\n "
845
839
" myparamnameiswaytooloooong) {\n "
846
840
" }\n "
847
841
" }" ,
848
842
" class C {\n "
849
843
" async hello(myparamnameiswaytooloooong) {} }" ,
850
- Style );
844
+ getGoogleJSStyleWithColumns ( 10 ) );
851
845
verifyFormat (" async function* f() {\n "
852
846
" yield fetch(x);\n "
853
847
" }" );
@@ -1344,16 +1338,15 @@ TEST_F(FormatTestJS, WrapRespectsAutomaticSemicolonInsertion) {
1344
1338
// The following statements must not wrap, as otherwise the program meaning
1345
1339
// would change due to automatic semicolon insertion.
1346
1340
// 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 ));
1357
1350
verifyFormat (" return [\n "
1358
1351
" aaa\n "
1359
1352
" ];" ,
@@ -1373,13 +1366,12 @@ TEST_F(FormatTestJS, WrapRespectsAutomaticSemicolonInsertion) {
1373
1366
// Ideally the foo() bit should be indented relative to the async function().
1374
1367
verifyFormat (" async function\n "
1375
1368
" 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 ));
1380
1372
verifyFormat (" x = (a['a']\n "
1381
1373
" ['b']);" ,
1382
- Style );
1374
+ getGoogleJSStyleWithColumns ( 10 ) );
1383
1375
verifyFormat (" function f() {\n "
1384
1376
" return foo.bar(\n "
1385
1377
" (param): param is {\n "
@@ -2508,10 +2500,6 @@ TEST_F(FormatTestJS, NonNullAssertionOperator) {
2508
2500
TEST_F (FormatTestJS, CppKeywords) {
2509
2501
// Make sure we don't mess stuff up because of C++ keywords.
2510
2502
verifyFormat (" return operator && (aa);" );
2511
- verifyFormat (" enum operator {\n "
2512
- " A = 1,\n "
2513
- " B\n "
2514
- " }" );
2515
2503
// .. or QT ones.
2516
2504
verifyFormat (" const slots: Slot[];" );
2517
2505
// use the "!" assertion operator to validate that clang-format understands
0 commit comments