Skip to content

Commit

Permalink
Added test case for comment on jkbrzt#90
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalomiri committed Apr 30, 2015
1 parent 1fcff97 commit 4ca60f5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2278,6 +2278,22 @@ testRecurring('testSubsecondStartMonthlyByMonthDay' , new RRule({
}),
[new Date(1356991200001)]);

test('testAfterBefore', function(){
"YEARLY,MONTHLY,DAILY,HOURLY,MINUTELY,SECONDLY".split(',').forEach( function (freq_str){
var date= new Date(1356991200001);
var rr= new RRule({
freq:RRule[freq_str],
dtstart:date
});
equal(date.getTime(), rr.options.dtstart.getTime(), "the supplied dtstart differs from RRule.options.dtstart");
res=rr.before(rr.after(rr.options.dtstart));
if (!(res == null)) {
// on purpose ==, so that undefined also matches
res=res.getTime();
}
equal( res, rr.options.dtstart.getTime(), 'after dtstart , followed by before does not return dtstart');
});
})

/* these tests basically test the iterator implementation only */
/*
Expand Down

0 comments on commit 4ca60f5

Please sign in to comment.