|
27 | 27 | instance_of,
|
28 | 28 | is_not,
|
29 | 29 | matches_regexp )
|
30 |
| -from pprint import pformat |
31 | 30 | import itertools
|
32 | 31 | import requests
|
33 | 32 | import json
|
@@ -108,15 +107,16 @@ def RunTest( app, test, contents = None ):
|
108 | 107 | expect_errors = True
|
109 | 108 | )
|
110 | 109 |
|
111 |
| - print( f'completer response: { pformat( response.json ) }' ) |
112 |
| - |
113 | 110 | assert_that( response.status_code,
|
114 | 111 | equal_to( test[ 'expect' ][ 'response' ] ) )
|
115 | 112 |
|
116 | 113 | assert_that( response.json, test[ 'expect' ][ 'data' ] )
|
117 | 114 | break
|
118 | 115 | except AssertionError:
|
119 | 116 | if time.time() > expiry:
|
| 117 | + print( 'completer response: ' |
| 118 | + f'{ json.dumps( response.json, indent=2 ) }' ) |
| 119 | + |
120 | 120 | raise
|
121 | 121 |
|
122 | 122 | time.sleep( 0.25 )
|
@@ -1089,6 +1089,10 @@ def test_Subcommands_FixIt_SingleDiag_MultipleOption_Insertion( self, app ):
|
1089 | 1089 | LocationMatcher( filepath, 25, 5 ) ),
|
1090 | 1090 | ),
|
1091 | 1091 | } ),
|
| 1092 | + has_entries( { |
| 1093 | + 'kind': 'quickassist', |
| 1094 | + 'text': "Add Javadoc for 'Wimble'" |
| 1095 | + } ), |
1092 | 1096 | )
|
1093 | 1097 | } )
|
1094 | 1098 |
|
@@ -1147,6 +1151,9 @@ def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ):
|
1147 | 1151 | LocationMatcher( filepath, 25, 5 ) ),
|
1148 | 1152 | ),
|
1149 | 1153 | } ),
|
| 1154 | + has_entries( { |
| 1155 | + 'text': "Add Javadoc for 'getWidget'" |
| 1156 | + } ), |
1150 | 1157 | )
|
1151 | 1158 | } )
|
1152 | 1159 |
|
@@ -1179,21 +1186,42 @@ def test_Subcommands_FixIt_SingleDiag_MultiOption_Delete( self, app ):
|
1179 | 1186 | # FixIt (and nonetheless, the previous tests ensure that we correctly
|
1180 | 1187 | # populate the chunks list; the contents all come from jdt.ls)
|
1181 | 1188 | has_entries( {
|
1182 |
| - 'text': "Create getter and setter for 'testString'", |
| 1189 | + 'text': "Organize imports", |
1183 | 1190 | 'chunks': instance_of( list )
|
1184 | 1191 | } ),
|
1185 | 1192 | has_entries( {
|
1186 |
| - 'text': "Organize imports", |
| 1193 | + 'text': "Generate Getter and Setter for 'testString'", |
1187 | 1194 | 'chunks': instance_of( list )
|
1188 | 1195 | } ),
|
1189 | 1196 | has_entries( {
|
1190 | 1197 | 'text': "Generate Getters and Setters",
|
1191 | 1198 | 'chunks': instance_of( list )
|
1192 | 1199 | } ),
|
| 1200 | + has_entries( { |
| 1201 | + 'text': "Generate Getters", |
| 1202 | + 'chunks': instance_of( list ) |
| 1203 | + } ), |
| 1204 | + has_entries( { |
| 1205 | + 'text': "Generate Setters", |
| 1206 | + 'chunks': instance_of( list ) |
| 1207 | + } ), |
| 1208 | + has_entries( { |
| 1209 | + 'text': "Generate Getter for 'testString'", |
| 1210 | + 'chunks': instance_of( list ) |
| 1211 | + } ), |
| 1212 | + has_entries( { |
| 1213 | + 'text': "Generate Setter for 'testString'", |
| 1214 | + 'chunks': instance_of( list ) |
| 1215 | + } ), |
1193 | 1216 | has_entries( {
|
1194 | 1217 | 'text': 'Change modifiers to final where possible',
|
1195 | 1218 | 'chunks': instance_of( list )
|
1196 | 1219 | } ),
|
| 1220 | + has_entries( { |
| 1221 | + 'kind': 'quickassist', |
| 1222 | + 'text': "Add Javadoc for 'testString'", |
| 1223 | + 'chunks': instance_of( list ) |
| 1224 | + } ), |
1197 | 1225 | )
|
1198 | 1226 | } )
|
1199 | 1227 |
|
@@ -1272,6 +1300,10 @@ def test_Subcommands_FixIt_MultipleDiags( self, app ):
|
1272 | 1300 | 'text': 'Change modifiers to final where possible',
|
1273 | 1301 | 'chunks': instance_of( list ),
|
1274 | 1302 | } ),
|
| 1303 | + has_entries( { |
| 1304 | + 'text': "Add Javadoc for 'getWidget'", |
| 1305 | + 'chunks': instance_of( list ), |
| 1306 | + } ), |
1275 | 1307 | ]
|
1276 | 1308 |
|
1277 | 1309 | FIXITS = {
|
@@ -1396,6 +1428,10 @@ def test_Subcommands_FixIt_Range( self, app ):
|
1396 | 1428 | 'text': 'Change modifiers to final where possible',
|
1397 | 1429 | 'chunks': instance_of( list ),
|
1398 | 1430 | } ),
|
| 1431 | + has_entries( { |
| 1432 | + 'text': "Add Javadoc for 'launch'", |
| 1433 | + 'chunks': instance_of( list ), |
| 1434 | + } ), |
1399 | 1435 | )
|
1400 | 1436 | } )
|
1401 | 1437 | }
|
@@ -1460,10 +1496,19 @@ def test_Subcommands_FixIt_Unicode( self, app ):
|
1460 | 1496 | 'text': 'Change modifiers to final where possible',
|
1461 | 1497 | 'chunks': instance_of( list ),
|
1462 | 1498 | } ),
|
| 1499 | + has_entries( { |
| 1500 | + 'text': "Generate Getters", |
| 1501 | + } ), |
| 1502 | + has_entries( { |
| 1503 | + 'text': "Generate Setters", |
| 1504 | + } ), |
1463 | 1505 | has_entries( {
|
1464 | 1506 | 'text': "Generate Getters and Setters",
|
1465 | 1507 | 'chunks': instance_of( list ),
|
1466 | 1508 | } ),
|
| 1509 | + has_entries( { |
| 1510 | + 'text': "Add Javadoc for 'DoWhatever'" |
| 1511 | + } ), |
1467 | 1512 | )
|
1468 | 1513 | } )
|
1469 | 1514 |
|
@@ -1525,6 +1570,9 @@ def test_Subcommands_FixIt_InvalidURI( self, app ):
|
1525 | 1570 | LocationMatcher( '', 32, 4 ) ),
|
1526 | 1571 | ),
|
1527 | 1572 | } ),
|
| 1573 | + has_entries( { |
| 1574 | + 'text': "Add Javadoc for 'getWidget'" |
| 1575 | + } ), |
1528 | 1576 | )
|
1529 | 1577 | } )
|
1530 | 1578 |
|
@@ -1638,6 +1686,9 @@ def test_Subcommands_Format_WholeFile_Spaces( self, app ):
|
1638 | 1686 | ChunkMatcher( '\n ',
|
1639 | 1687 | LocationMatcher( TEST_JAVA, 24, 27 ),
|
1640 | 1688 | LocationMatcher( TEST_JAVA, 25, 3 ) ),
|
| 1689 | + ChunkMatcher( '\n', |
| 1690 | + LocationMatcher( TEST_JAVA, 26, 2 ), |
| 1691 | + LocationMatcher( TEST_JAVA, 28, 1 ) ), |
1641 | 1692 | )
|
1642 | 1693 | } ) )
|
1643 | 1694 | } )
|
@@ -1724,6 +1775,9 @@ def test_Subcommands_Format_WholeFile_Tabs( self, app ):
|
1724 | 1775 | ChunkMatcher( '\n\t',
|
1725 | 1776 | LocationMatcher( TEST_JAVA, 24, 27 ),
|
1726 | 1777 | LocationMatcher( TEST_JAVA, 25, 3 ) ),
|
| 1778 | + ChunkMatcher( '\n', |
| 1779 | + LocationMatcher( TEST_JAVA, 26, 2 ), |
| 1780 | + LocationMatcher( TEST_JAVA, 28, 1 ) ), |
1727 | 1781 | )
|
1728 | 1782 | } ) )
|
1729 | 1783 | } )
|
|
0 commit comments