@@ -526,13 +526,13 @@ describe('Test lib.js:', function() {
526526 . toEqual ( '42' ) ;
527527
528528 expect ( coerce ( { s : [ 1 , 2 , 3 ] } , { } , stringAttrs , 's' ) )
529- . toEqual ( '1,2,3' ) ;
529+ . toEqual ( dflt ) ;
530530
531531 expect ( coerce ( { s : true } , { } , stringAttrs , 's' ) )
532532 . toEqual ( 'true' ) ;
533533
534534 expect ( coerce ( { s : { 1 : 2 } } , { } , stringAttrs , 's' ) )
535- . toEqual ( '[object Object]' ) ; // useless, but that's what it does!!
535+ . toEqual ( dflt ) ;
536536 } ) ;
537537 } ) ;
538538
@@ -861,27 +861,26 @@ describe('Test lib.js:', function() {
861861 } ) ;
862862
863863 it ( 'should work for valType \'string\' where' , function ( ) {
864+ var date = new Date ( 2016 , 1 , 1 ) ;
864865
865- // This fails as the coerceFunction coerce all values
866- // (except when 'strict' is true) using String()
867- //
868- // Things like undefined, null, {}, [] should be considered valid!
869- //
870- // The question becomes how the change this while not
871- // scarifying perf??
872-
873- assert ( [ '3' , '4' , 'a' ] , [ undefined , { } , [ ] , null ] , {
866+ assert ( [ '3' , '4' , 'a' , 3 , 1.2113 , '' , date , false ] , [ undefined , { } , [ ] , null ] , {
874867 valType : 'string' ,
875868 dflt : 'a'
876869 } ) ;
877870
878- assert ( [ '3' , '4' , 'a' ] , [ undefined , { } , [ ] , null , '' ] , {
871+ assert ( [ '3' , '4' , 'a' , 3 , 1.2113 , date , true ] , [ '' , undefined , { } , [ ] , null ] , {
879872 valType : 'string' ,
880873 dflt : 'a' ,
881874 noBlank : true
882875 } ) ;
883876
884- assert ( [ '3' , '4' ] , [ undefined , 1 , { } , [ ] , null , '' ] , {
877+ assert ( [ '3' , '4' , '' ] , [ undefined , 1 , { } , [ ] , null , date , true , false ] , {
878+ valType : 'string' ,
879+ dflt : 'a' ,
880+ strict : true
881+ } ) ;
882+
883+ assert ( [ '3' , '4' ] , [ undefined , 1 , { } , [ ] , null , date , '' , true , false ] , {
885884 valType : 'string' ,
886885 dflt : 'a' ,
887886 strict : true ,
0 commit comments