@@ -67,37 +67,31 @@ void assignmentToVariables() {
67
67
parseCheck ("#var1='value1'" );
68
68
}
69
69
70
- @ Disabled ("toStringAST() is broken for array construction" )
71
70
@ Test
72
71
void collectionProcessorsCountStringArray () {
73
72
parseCheck ("new String[] {'abc','def','xyz'}.count()" );
74
73
}
75
74
76
- @ Disabled ("toStringAST() is broken for array construction" )
77
75
@ Test
78
76
void collectionProcessorsCountIntArray () {
79
77
parseCheck ("new int[] {1,2,3}.count()" );
80
78
}
81
79
82
- @ Disabled ("toStringAST() is broken for array construction" )
83
80
@ Test
84
81
void collectionProcessorsMax () {
85
82
parseCheck ("new int[] {1,2,3}.max()" );
86
83
}
87
84
88
- @ Disabled ("toStringAST() is broken for array construction" )
89
85
@ Test
90
86
void collectionProcessorsMin () {
91
87
parseCheck ("new int[] {1,2,3}.min()" );
92
88
}
93
89
94
- @ Disabled ("toStringAST() is broken for array construction" )
95
90
@ Test
96
91
void collectionProcessorsAverage () {
97
92
parseCheck ("new int[] {1,2,3}.average()" );
98
93
}
99
94
100
- @ Disabled ("toStringAST() is broken for array construction" )
101
95
@ Test
102
96
void collectionProcessorsSort () {
103
97
parseCheck ("new int[] {3,2,1}.sort()" );
@@ -438,32 +432,70 @@ class MethodsConstructorsAndArrays {
438
432
439
433
@ Test
440
434
void methods () {
435
+ parseCheck ("echo()" );
441
436
parseCheck ("echo(12)" );
442
437
parseCheck ("echo(name)" );
438
+ parseCheck ("echo('Jane')" );
439
+ parseCheck ("echo('Jane',32)" );
440
+ parseCheck ("echo('Jane', 32)" , "echo('Jane',32)" );
443
441
parseCheck ("age.doubleItAndAdd(12)" );
444
442
}
445
443
446
444
@ Test
447
- void constructors () {
445
+ void constructorWithNoArguments () {
446
+ parseCheck ("new Foo()" );
447
+ parseCheck ("new example.Foo()" );
448
+ }
449
+
450
+ @ Test
451
+ void constructorWithOneArgument () {
448
452
parseCheck ("new String('hello')" );
453
+ parseCheck ("new String( 'hello' )" , "new String('hello')" );
454
+ parseCheck ("new String(\" hello\" )" , "new String('hello')" );
455
+ }
456
+
457
+ @ Test
458
+ void constructorWithMultipleArguments () {
459
+ parseCheck ("new example.Person('Jane',32,true)" );
460
+ parseCheck ("new example.Person('Jane', 32, true)" , "new example.Person('Jane',32,true)" );
461
+ parseCheck ("new example.Person('Jane', 2 * 16, true)" , "new example.Person('Jane',(2 * 16),true)" );
449
462
}
450
463
451
- @ Disabled ("toStringAST() is broken for array construction" )
452
464
@ Test
453
- void arrayConstruction01 () {
465
+ void arrayConstructionWithOneDimensionalReferenceType () {
454
466
parseCheck ("new String[3]" );
455
467
}
456
468
457
- @ Disabled ("toStringAST() is broken for array construction" )
458
469
@ Test
459
- void arrayConstruction02 () {
460
- parseCheck ("new int[] {1, 2, 3, 4, 5}" , "new int[] {1,2,3,4,5}" );
470
+ void arrayConstructionWithOneDimensionalFullyQualifiedReferenceType () {
471
+ parseCheck ("new java.lang.String[3]" );
472
+ }
473
+
474
+ @ Test
475
+ void arrayConstructionWithOneDimensionalPrimitiveType () {
476
+ parseCheck ("new int[3]" );
461
477
}
462
478
463
- @ Disabled ("toStringAST() is broken for array construction" )
464
479
@ Test
465
- void arrayConstruction03 () {
466
- parseCheck ("new String[] {'abc','xyz'}" , "new String[] {'abc','xyz'}" );
480
+ void arrayConstructionWithMultiDimensionalReferenceType () {
481
+ parseCheck ("new Float[3][4]" );
482
+ }
483
+
484
+ @ Test
485
+ void arrayConstructionWithMultiDimensionalPrimitiveType () {
486
+ parseCheck ("new int[3][4]" );
487
+ }
488
+
489
+ @ Test
490
+ void arrayConstructionWithOneDimensionalReferenceTypeWithInitializer () {
491
+ parseCheck ("new String[] {'abc','xyz'}" );
492
+ parseCheck ("new String[] {'abc', 'xyz'}" , "new String[] {'abc','xyz'}" );
493
+ }
494
+
495
+ @ Test
496
+ void arrayConstructionWithOneDimensionalPrimitiveTypeWithInitializer () {
497
+ parseCheck ("new int[] {1,2,3,4,5}" );
498
+ parseCheck ("new int[] {1, 2, 3, 4, 5}" , "new int[] {1,2,3,4,5}" );
467
499
}
468
500
}
469
501
0 commit comments