@@ -46,6 +46,21 @@ describe("date_range", function(){
4646 assert . deepEqual ( d , rslt ) ;
4747
4848
49+ } ) ;
50+ it ( "Obtain date between start with end not specified, but period and freq specified, plus offset, longer freq" , function ( ) {
51+
52+ let d = new dfd . date_range ( { start :'1/1/2018' , period :5 , freq :'35m' } ) ;
53+ let rslt = [
54+ "1/1/2018, 12:00:00 AM" ,
55+ "1/1/2018, 12:35:00 AM" ,
56+ "1/1/2018, 1:10:00 AM" ,
57+ "1/1/2018, 1:45:00 AM" ,
58+ "1/1/2018, 2:20:00 AM"
59+ ] ;
60+
61+ assert . deepEqual ( d , rslt ) ;
62+
63+
4964 } ) ;
5065 it ( "Obtain date range with start not specified but end and period is given" , function ( ) {
5166
@@ -71,4 +86,7 @@ describe("date_range", function(){
7186 it ( "inputing wrong freq with offset" , function ( ) {
7287 assert . throws ( function ( ) { new dfd . date_range ( { end :'1/1/2018' , period :8 , freq :"4d" } ) ; } , Error , 'invalid freq d' ) ;
7388 } ) ;
89+ it ( "inputing wrong freq offset" , function ( ) {
90+ assert . throws ( function ( ) { new dfd . date_range ( { end :'1/1/2018' , period :8 , freq :"abcm" } ) ; } , Error , 'invalid freq offset abc' ) ;
91+ } ) ;
7492} ) ;
0 commit comments