@@ -29,6 +29,14 @@ public void testVarArgsEmpty() {
2929 assertEquals ("ints: " , s );
3030 }
3131
32+ /**
33+ * Call a varArgs method with exactly one argument.
34+ */
35+ public void testVarArgsExactlyOneArg () {
36+ String s = new CVarArgs ().fVarArgsInt (4 );
37+ assertEquals ("ints: 4 " , s );
38+ }
39+
3240 /**
3341 * Call a varArgs method with some arguments.
3442 */
@@ -55,7 +63,15 @@ public void testStringPlusVarArgsEmpty() {
5563 }
5664
5765 /**
58- * Call a varArgs method with a mandatory arguments and no optional arguments.
66+ * Call a varArgs method with a mandatory arguments and exactly one optional arguments.
67+ */
68+ public void testStringPlusVarArgsExactlyOneArg () {
69+ String s = new CVarArgs ().fStringVarArgsInt ("demo " , 4 );
70+ assertEquals ("demo 4 " , s );
71+ }
72+
73+ /**
74+ * Call a varArgs method with a mandatory arguments and some optional arguments.
5975 */
6076 public void testStringPlusVarArgsNotEmpty () {
6177 String s = new CVarArgs ().fStringVarArgsInt ("demo " , 4 , 7 );
@@ -78,6 +94,14 @@ public void testIntArrVarArgsNotEmpty() {
7894 assertEquals ("intss [3 5 7 ] [2 4 ] " , s );
7995 }
8096
97+ /**
98+ * Call a varArgs method of array type (here int[]) with exactly one argument.
99+ */
100+ public void testIntArrVarArgsExactlyOneArg () {
101+ String s = new CVarArgs ().fIntArr (new int []{2 ,4 });
102+ assertEquals ("intss [2 4 ] " , s );
103+ }
104+
81105 /**
82106 * Call a varArgs method of array type (here int[]) with some arguments (via array).
83107 */
0 commit comments