@@ -98,3 +98,27 @@ describe( 'isFiniteInteger', function () {
9898 } ) ;
9999 } ) ;
100100} ) ;
101+
102+ describe ( 'isIntegerArray' , function ( ) {
103+ var tests = [
104+ { expectedOutputIs : false , whenInputIs : undefined } ,
105+ { expectedOutputIs : false , whenInputIs : null } ,
106+ { expectedOutputIs : false , whenInputIs : [ ] } ,
107+ { expectedOutputIs : false , whenInputIs : [ - 1.1 ] } ,
108+ { expectedOutputIs : false , whenInputIs : [ 1.00001 ] } ,
109+ { expectedOutputIs : false , whenInputIs : [ { } ] } ,
110+ { expectedOutputIs : false , whenInputIs : [ [ ] ] } ,
111+ { expectedOutputIs : false , whenInputIs : [ 1 , 2 , [ ] ] } ,
112+ { expectedOutputIs : false , whenInputIs : [ 1 , 2 , { } ] } ,
113+ { expectedOutputIs : false , whenInputIs : [ 1 , 2 , 1.1 ] } ,
114+ { expectedOutputIs : true , whenInputIs : [ 1 ] } ,
115+ { expectedOutputIs : true , whenInputIs : [ 999999 ] } ,
116+ { expectedOutputIs : true , whenInputIs : [ - 999999 ] } ,
117+ { expectedOutputIs : true , whenInputIs : [ - 999999 , 1 , 2 ] }
118+ ] ;
119+ tests . forEach ( function ( t ) {
120+ it ( 'should return ' + JSON . stringify ( t . expectedOutputIs ) + '\n\tif the input is ' + JSON . stringify ( t . whenInputIs ) , function ( ) {
121+ expect ( helper . isIntegerArray ( t . whenInputIs ) ) . to . equal ( t . expectedOutputIs ) ;
122+ } ) ;
123+ } ) ;
124+ } ) ;
0 commit comments