Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ea1a6c

Browse files
smowtonigfoo
authored andcommitted
Adjust test expectations
These all just refer to re-adding empty blocks for classes whose constructors have no initializer statements for simplicity's sake.
1 parent 35d213a commit 2ea1a6c

4 files changed

Lines changed: 61 additions & 0 deletions

File tree

java/ql/test/kotlin/library-tests/classes/PrintAst.expected

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ classes.kt:
99
# 2| 1: [Constructor] ClassOne
1010
# 2| 5: [BlockStmt] { ... }
1111
# 2| 0: [SuperConstructorInvocationStmt] super(...)
12+
# 2| 1: [BlockStmt] { ... }
1213
# 4| 3: [Class] ClassTwo
1314
# 4| 1: [Constructor] ClassTwo
1415
#-----| 4: (Parameters)
@@ -42,13 +43,15 @@ classes.kt:
4243
# 8| 1: [Constructor] ClassThree
4344
# 8| 5: [BlockStmt] { ... }
4445
# 8| 0: [SuperConstructorInvocationStmt] super(...)
46+
# 8| 1: [BlockStmt] { ... }
4547
# 9| 2: [Method] foo
4648
#-----| 4: (Parameters)
4749
# 9| 0: [Parameter] arg
4850
# 12| 5: [Class] ClassFour
4951
# 12| 1: [Constructor] ClassFour
5052
# 12| 5: [BlockStmt] { ... }
5153
# 12| 0: [SuperConstructorInvocationStmt] super(...)
54+
# 12| 1: [BlockStmt] { ... }
5255
# 13| 2: [Method] foo
5356
#-----| 4: (Parameters)
5457
# 13| 0: [Parameter] arg
@@ -57,6 +60,7 @@ classes.kt:
5760
# 17| 1: [Constructor] ClassFive
5861
# 17| 5: [BlockStmt] { ... }
5962
# 17| 0: [SuperConstructorInvocationStmt] super(...)
63+
# 17| 1: [BlockStmt] { ... }
6064
# 20| 7: [Interface] IF1
6165
# 21| 1: [Method] funIF1
6266
# 21| 5: [BlockStmt] { ... }
@@ -67,6 +71,7 @@ classes.kt:
6771
# 28| 1: [Constructor] ClassSix
6872
# 28| 5: [BlockStmt] { ... }
6973
# 28| 0: [SuperConstructorInvocationStmt] super(...)
74+
# 28| 1: [BlockStmt] { ... }
7075
# 29| 2: [Constructor] ClassSix
7176
#-----| 4: (Parameters)
7277
# 29| 0: [Parameter] i
@@ -110,6 +115,7 @@ classes.kt:
110115
# 49| 0: [ClassInstanceExpr] new Enum(...)
111116
# 49| -3: [TypeAccess] Unit
112117
# 49| 0: [TypeAccess] Direction
118+
# 49| 1: [BlockStmt] { ... }
113119
# 53| 12: [Class] Color
114120
# 0| 1: [Method] values
115121
# 0| 1: [Method] valueOf
@@ -144,6 +150,7 @@ classes.kt:
144150
# 63| 1: [Constructor] Class1
145151
# 63| 5: [BlockStmt] { ... }
146152
# 63| 0: [SuperConstructorInvocationStmt] super(...)
153+
# 63| 1: [BlockStmt] { ... }
147154
# 64| 2: [Method] getObject1
148155
#-----| 4: (Parameters)
149156
# 64| 0: [Parameter] b
@@ -160,6 +167,7 @@ classes.kt:
160167
# 66| 1: [Constructor]
161168
# 66| 5: [BlockStmt] { ... }
162169
# 66| 0: [SuperConstructorInvocationStmt] super(...)
170+
# 66| 1: [BlockStmt] { ... }
163171
# 66| 1: [ExprStmt] <Expr>;
164172
# 66| 0: [ClassInstanceExpr] new (...)
165173
# 66| -3: [TypeAccess] Object
@@ -173,6 +181,7 @@ classes.kt:
173181
# 68| 1: [Constructor]
174182
# 68| 5: [BlockStmt] { ... }
175183
# 68| 0: [SuperConstructorInvocationStmt] super(...)
184+
# 68| 1: [BlockStmt] { ... }
176185
# 68| 1: [ExprStmt] <Expr>;
177186
# 68| 0: [ClassInstanceExpr] new (...)
178187
# 68| -3: [TypeAccess] Object
@@ -208,6 +217,7 @@ classes.kt:
208217
# 75| 1: [Constructor]
209218
# 75| 5: [BlockStmt] { ... }
210219
# 75| 0: [SuperConstructorInvocationStmt] super(...)
220+
# 75| 1: [BlockStmt] { ... }
211221
# 75| 1: [ExprStmt] <Expr>;
212222
# 75| 0: [ClassInstanceExpr] new (...)
213223
# 75| -3: [TypeAccess] Object
@@ -224,6 +234,7 @@ classes.kt:
224234
# 81| 1: [Constructor]
225235
# 81| 5: [BlockStmt] { ... }
226236
# 81| 0: [SuperConstructorInvocationStmt] super(...)
237+
# 81| 1: [BlockStmt] { ... }
227238
# 81| 1: [ExprStmt] <Expr>;
228239
# 81| 0: [ClassInstanceExpr] new (...)
229240
# 81| -3: [TypeAccess] Interface1
@@ -237,6 +248,7 @@ classes.kt:
237248
# 85| 1: [Constructor]
238249
# 85| 5: [BlockStmt] { ... }
239250
# 85| 0: [SuperConstructorInvocationStmt] super(...)
251+
# 85| 1: [BlockStmt] { ... }
240252
# 85| 1: [ExprStmt] <Expr>;
241253
# 85| 0: [ClassInstanceExpr] new (...)
242254
# 85| -3: [TypeAccess] Object
@@ -250,61 +262,75 @@ classes.kt:
250262
# 89| 1: [Constructor]
251263
# 89| 5: [BlockStmt] { ... }
252264
# 89| 0: [SuperConstructorInvocationStmt] super(...)
265+
# 89| 1: [BlockStmt] { ... }
253266
# 89| 1: [ExprStmt] <Expr>;
254267
# 89| 0: [ClassInstanceExpr] new (...)
255268
# 89| -3: [TypeAccess] Interface3<Integer>
256269
# 93| 19: [Class] pulicClass
257270
# 93| 1: [Constructor] pulicClass
258271
# 93| 5: [BlockStmt] { ... }
259272
# 93| 0: [SuperConstructorInvocationStmt] super(...)
273+
# 93| 1: [BlockStmt] { ... }
260274
# 94| 20: [Class] privateClass
261275
# 94| 1: [Constructor] privateClass
262276
# 94| 5: [BlockStmt] { ... }
263277
# 94| 0: [SuperConstructorInvocationStmt] super(...)
278+
# 94| 1: [BlockStmt] { ... }
264279
# 95| 21: [Class] internalClass
265280
# 95| 1: [Constructor] internalClass
266281
# 95| 5: [BlockStmt] { ... }
267282
# 95| 0: [SuperConstructorInvocationStmt] super(...)
283+
# 95| 1: [BlockStmt] { ... }
268284
# 96| 22: [Class] noExplicitVisibilityClass
269285
# 96| 1: [Constructor] noExplicitVisibilityClass
270286
# 96| 5: [BlockStmt] { ... }
271287
# 96| 0: [SuperConstructorInvocationStmt] super(...)
288+
# 96| 1: [BlockStmt] { ... }
272289
# 98| 23: [Class] nestedClassVisibilities
273290
# 98| 1: [Constructor] nestedClassVisibilities
274291
# 98| 5: [BlockStmt] { ... }
275292
# 98| 0: [SuperConstructorInvocationStmt] super(...)
293+
# 98| 1: [BlockStmt] { ... }
276294
# 99| 2: [Class] pulicNestedClass
277295
# 99| 1: [Constructor] pulicNestedClass
278296
# 99| 5: [BlockStmt] { ... }
279297
# 99| 0: [SuperConstructorInvocationStmt] super(...)
298+
# 99| 1: [BlockStmt] { ... }
280299
# 100| 3: [Class] protectedNestedClass
281300
# 100| 1: [Constructor] protectedNestedClass
282301
# 100| 5: [BlockStmt] { ... }
283302
# 100| 0: [SuperConstructorInvocationStmt] super(...)
303+
# 100| 1: [BlockStmt] { ... }
284304
# 101| 4: [Class] privateNestedClass
285305
# 101| 1: [Constructor] privateNestedClass
286306
# 101| 5: [BlockStmt] { ... }
287307
# 101| 0: [SuperConstructorInvocationStmt] super(...)
308+
# 101| 1: [BlockStmt] { ... }
288309
# 102| 5: [Class] internalNestedClass
289310
# 102| 1: [Constructor] internalNestedClass
290311
# 102| 5: [BlockStmt] { ... }
291312
# 102| 0: [SuperConstructorInvocationStmt] super(...)
313+
# 102| 1: [BlockStmt] { ... }
292314
# 103| 6: [Class] noExplicitVisibilityNestedClass
293315
# 103| 1: [Constructor] noExplicitVisibilityNestedClass
294316
# 103| 5: [BlockStmt] { ... }
295317
# 103| 0: [SuperConstructorInvocationStmt] super(...)
318+
# 103| 1: [BlockStmt] { ... }
296319
# 106| 24: [Class] sealedClass
297320
# 106| 1: [Constructor] sealedClass
298321
# 106| 5: [BlockStmt] { ... }
299322
# 106| 0: [SuperConstructorInvocationStmt] super(...)
323+
# 106| 1: [BlockStmt] { ... }
300324
# 107| 25: [Class] openClass
301325
# 107| 1: [Constructor] openClass
302326
# 107| 5: [BlockStmt] { ... }
303327
# 107| 0: [SuperConstructorInvocationStmt] super(...)
328+
# 107| 1: [BlockStmt] { ... }
304329
# 109| 26: [Class] C1
305330
# 109| 1: [Constructor] C1
306331
# 109| 5: [BlockStmt] { ... }
307332
# 109| 0: [SuperConstructorInvocationStmt] super(...)
333+
# 109| 1: [BlockStmt] { ... }
308334
# 110| 2: [Method] fn1
309335
#-----| 4: (Parameters)
310336
# 110| 0: [Parameter] p
@@ -316,6 +342,7 @@ classes.kt:
316342
# 111| 1: [Constructor] Local1
317343
# 111| 5: [BlockStmt] { ... }
318344
# 111| 0: [SuperConstructorInvocationStmt] super(...)
345+
# 111| 1: [BlockStmt] { ... }
319346
# 112| 2: [Method] foo
320347
#-----| 4: (Parameters)
321348
# 112| 0: [Parameter] p
@@ -344,6 +371,7 @@ classes.kt:
344371
# 119| 1: [Constructor] Local2
345372
# 119| 5: [BlockStmt] { ... }
346373
# 119| 0: [SuperConstructorInvocationStmt] super(...)
374+
# 119| 1: [BlockStmt] { ... }
347375
# 120| 2: [Method] foo
348376
#-----| 4: (Parameters)
349377
# 120| 0: [Parameter] p
@@ -366,6 +394,7 @@ classes.kt:
366394
# 127| 1: [Constructor]
367395
# 127| 5: [BlockStmt] { ... }
368396
# 127| 0: [SuperConstructorInvocationStmt] super(...)
397+
# 127| 1: [BlockStmt] { ... }
369398
# 128| 2: [Method] fn
370399
# 128| 5: [BlockStmt] { ... }
371400
# 129| 0: [LocalTypeDeclStmt] class ...
@@ -375,6 +404,7 @@ classes.kt:
375404
# 129| 1: [Constructor] Local3
376405
# 129| 5: [BlockStmt] { ... }
377406
# 129| 0: [SuperConstructorInvocationStmt] super(...)
407+
# 129| 1: [BlockStmt] { ... }
378408
# 130| 2: [Method] foo
379409
#-----| 4: (Parameters)
380410
# 130| 0: [Parameter] p
@@ -394,6 +424,7 @@ local_anonymous.kt:
394424
# 3| 1: [Constructor] Class1
395425
# 3| 5: [BlockStmt] { ... }
396426
# 3| 0: [SuperConstructorInvocationStmt] super(...)
427+
# 3| 1: [BlockStmt] { ... }
397428
# 4| 2: [Method] fn1
398429
# 4| 5: [BlockStmt] { ... }
399430
# 5| 0: [ReturnStmt] return ...
@@ -404,6 +435,7 @@ local_anonymous.kt:
404435
# 5| 1: [Constructor]
405436
# 5| 5: [BlockStmt] { ... }
406437
# 5| 0: [SuperConstructorInvocationStmt] super(...)
438+
# 5| 1: [BlockStmt] { ... }
407439
# 6| 2: [Method] fn
408440
# 6| 5: [BlockStmt] { ... }
409441
# 5| 1: [ExprStmt] <Expr>;
@@ -490,6 +522,7 @@ local_anonymous.kt:
490522
# 25| 1: [Constructor] LocalClass
491523
# 25| 5: [BlockStmt] { ... }
492524
# 25| 0: [SuperConstructorInvocationStmt] super(...)
525+
# 25| 1: [BlockStmt] { ... }
493526
# 26| 1: [ExprStmt] <Expr>;
494527
# 26| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
495528
# 26| 0: [TypeAccess] Unit
@@ -504,17 +537,20 @@ superChain.kt:
504537
# 1| 1: [Constructor] SuperChain1
505538
# 1| 5: [BlockStmt] { ... }
506539
# 1| 0: [SuperConstructorInvocationStmt] super(...)
540+
# 1| 1: [BlockStmt] { ... }
507541
# 2| 4: [Class,GenericType,ParameterizedType] SuperChain2
508542
#-----| -2: (Generic Parameters)
509543
# 2| 0: [TypeVariable] T3
510544
# 2| 1: [TypeVariable] T4
511545
# 2| 1: [Constructor] SuperChain2
512546
# 2| 5: [BlockStmt] { ... }
513547
# 2| 0: [SuperConstructorInvocationStmt] super(...)
548+
# 2| 1: [BlockStmt] { ... }
514549
# 3| 6: [Class,GenericType,ParameterizedType] SuperChain3
515550
#-----| -2: (Generic Parameters)
516551
# 3| 0: [TypeVariable] T5
517552
# 3| 1: [TypeVariable] T6
518553
# 3| 1: [Constructor] SuperChain3
519554
# 3| 5: [BlockStmt] { ... }
520555
# 3| 0: [SuperConstructorInvocationStmt] super(...)
556+
# 3| 1: [BlockStmt] { ... }

java/ql/test/kotlin/library-tests/exprs/PrintAst.expected

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ delegatedProperties.kt:
111111
# 4| 1: [Constructor] ClassProp1
112112
# 4| 5: [BlockStmt] { ... }
113113
# 4| 0: [SuperConstructorInvocationStmt] super(...)
114+
# 4| 1: [BlockStmt] { ... }
114115
# 5| 2: [Method] fn
115116
# 5| 5: [BlockStmt] { ... }
116117
# 6| 0: [BlockStmt] { ... }
@@ -174,6 +175,7 @@ delegatedProperties.kt:
174175
# 15| 1: [Constructor] Resource
175176
# 15| 5: [BlockStmt] { ... }
176177
# 15| 0: [SuperConstructorInvocationStmt] super(...)
178+
# 15| 1: [BlockStmt] { ... }
177179
# 17| 4: [Class] Owner
178180
# 17| 1: [Constructor] Owner
179181
# 17| 5: [BlockStmt] { ... }
@@ -566,6 +568,7 @@ delegatedProperties.kt:
566568
# 45| 1: [Constructor] ResourceDelegate
567569
# 45| 5: [BlockStmt] { ... }
568570
# 45| 0: [SuperConstructorInvocationStmt] super(...)
571+
# 45| 1: [BlockStmt] { ... }
569572
# 46| 2: [Method] getValue
570573
#-----| 4: (Parameters)
571574
# 46| 0: [Parameter] thisRef
@@ -583,6 +586,7 @@ delegatedProperties.kt:
583586
# 53| 1: [Constructor] DelegateProvider
584587
# 53| 5: [BlockStmt] { ... }
585588
# 53| 0: [SuperConstructorInvocationStmt] super(...)
589+
# 53| 1: [BlockStmt] { ... }
586590
# 54| 2: [Method] provideDelegate
587591
#-----| 4: (Parameters)
588592
# 54| 0: [Parameter] thisRef
@@ -2421,14 +2425,17 @@ exprs.kt:
24212425
# 146| 1: [Constructor] Root
24222426
# 146| 5: [BlockStmt] { ... }
24232427
# 146| 0: [SuperConstructorInvocationStmt] super(...)
2428+
# 146| 1: [BlockStmt] { ... }
24242429
# 147| 4: [Class] Subclass1
24252430
# 147| 1: [Constructor] Subclass1
24262431
# 147| 5: [BlockStmt] { ... }
24272432
# 147| 0: [SuperConstructorInvocationStmt] super(...)
2433+
# 147| 1: [BlockStmt] { ... }
24282434
# 148| 5: [Class] Subclass2
24292435
# 148| 1: [Constructor] Subclass2
24302436
# 148| 5: [BlockStmt] { ... }
24312437
# 148| 0: [SuperConstructorInvocationStmt] super(...)
2438+
# 148| 1: [BlockStmt] { ... }
24322439
# 168| 6: [Class] Direction
24332440
# 0| 1: [Method] values
24342441
# 0| 1: [Method] valueOf
@@ -2440,6 +2447,7 @@ exprs.kt:
24402447
# 168| 0: [ClassInstanceExpr] new Enum(...)
24412448
# 168| -3: [TypeAccess] Unit
24422449
# 168| 0: [TypeAccess] Direction
2450+
# 168| 1: [BlockStmt] { ... }
24432451
# 172| 7: [Class] Color
24442452
# 0| 1: [Method] values
24452453
# 0| 1: [Method] valueOf
@@ -2518,6 +2526,7 @@ exprs.kt:
25182526
# 199| 1: [Constructor] Class2
25192527
# 199| 5: [BlockStmt] { ... }
25202528
# 199| 0: [SuperConstructorInvocationStmt] super(...)
2529+
# 199| 1: [BlockStmt] { ... }
25212530
# 200| 2: [Method] x
25222531
#-----| 4: (Parameters)
25232532
# 200| 0: [Parameter] aa
@@ -2573,6 +2582,7 @@ exprs.kt:
25732582
# 218| 1: [Constructor] SomeClass1
25742583
# 218| 5: [BlockStmt] { ... }
25752584
# 218| 0: [SuperConstructorInvocationStmt] super(...)
2585+
# 218| 1: [BlockStmt] { ... }
25762586
funcExprs.kt:
25772587
# 0| [CompilationUnit] funcExprs
25782588
# 0| 1: [Class] FuncExprsKt
@@ -3641,6 +3651,7 @@ funcExprs.kt:
36413651
# 48| 1: [Constructor] MyLambda
36423652
# 48| 5: [BlockStmt] { ... }
36433653
# 48| 0: [SuperConstructorInvocationStmt] super(...)
3654+
# 48| 1: [BlockStmt] { ... }
36443655
# 49| 2: [Method] invoke
36453656
#-----| 4: (Parameters)
36463657
# 49| 0: [Parameter] x
@@ -3651,10 +3662,12 @@ funcExprs.kt:
36513662
# 55| 1: [Constructor] FuncRef
36523663
# 55| 5: [BlockStmt] { ... }
36533664
# 55| 0: [SuperConstructorInvocationStmt] super(...)
3665+
# 55| 1: [BlockStmt] { ... }
36543666
# 56| 2: [Class] Companion
36553667
# 56| 1: [Constructor] Companion
36563668
# 56| 5: [BlockStmt] { ... }
36573669
# 56| 0: [SuperConstructorInvocationStmt] super(...)
3670+
# 56| 1: [BlockStmt] { ... }
36583671
# 57| 2: [Method] f0
36593672
# 57| 5: [BlockStmt] { ... }
36603673
# 57| 0: [ReturnStmt] return ...
@@ -3726,6 +3739,7 @@ funcExprs.kt:
37263739
# 67| 1: [Constructor] Class3
37273740
# 67| 5: [BlockStmt] { ... }
37283741
# 67| 0: [SuperConstructorInvocationStmt] super(...)
3742+
# 67| 1: [BlockStmt] { ... }
37293743
# 68| 2: [Method] call
37303744
# 68| 5: [BlockStmt] { ... }
37313745
# 69| 0: [ExprStmt] <Expr>;
@@ -3757,6 +3771,7 @@ funcExprs.kt:
37573771
# 73| 1: [Constructor] Generic
37583772
# 73| 5: [BlockStmt] { ... }
37593773
# 73| 0: [SuperConstructorInvocationStmt] super(...)
3774+
# 73| 1: [BlockStmt] { ... }
37603775
localFunctionCalls.kt:
37613776
# 0| [CompilationUnit] localFunctionCalls
37623777
# 0| 1: [Class] LocalFunctionCallsKt
@@ -3838,6 +3853,7 @@ localFunctionCalls.kt:
38383853
# 14| 1: [Constructor] C1
38393854
# 14| 5: [BlockStmt] { ... }
38403855
# 14| 0: [SuperConstructorInvocationStmt] super(...)
3856+
# 14| 1: [BlockStmt] { ... }
38413857
samConversion.kt:
38423858
# 0| [CompilationUnit] samConversion
38433859
# 0| 1: [Class] SamConversionKt

java/ql/test/kotlin/library-tests/extensions_recursion/element.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
| test.kt:6:1:10:1 | Foo | Constructor |
1212
| test.kt:6:1:10:1 | super(...) | SuperConstructorInvocationStmt |
1313
| test.kt:6:1:10:1 | { ... } | BlockStmt |
14+
| test.kt:6:1:10:1 | { ... } | BlockStmt |
1415
| test.kt:6:11:6:11 | T | TypeVariable |
1516
| test.kt:7:5:9:5 | foo | Method |
1617
| test.kt:7:24:9:5 | { ... } | BlockStmt |

0 commit comments

Comments
 (0)