X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=test%2Fcalendar_event_test.pl;h=0defafa220fdc24bb0b72054a52d908db1e10f8f;hp=ec8fcc0c84db97a50a583fa3b1dcfd29a4854c3b;hb=91bae4c070fe0d592be203e29b921b8c54e21b25;hpb=a4200306fe8c25230512f1fdcb74ddfd2b675504 diff --git a/test/calendar_event_test.pl b/test/calendar_event_test.pl index ec8fcc0..0defafa 100755 --- a/test/calendar_event_test.pl +++ b/test/calendar_event_test.pl @@ -132,7 +132,49 @@ my $tests = [ [20*60*60, 20*60*60 + 30*60], [22*60*60 + 30*60, 44*60*60] ] - ] + ], + [ + '61', + { error => "value '61' out of range" }, + ], + [ + '*/61', + { error => "repetition '61' out of range" }, + ], + [ + '0..80', + { error => "range end '80' out of range" }, + ], + [ + ' mon 0 0 0', + { error => "unable to parse calendar event - unused parts" }, + ], + [ + '', + { error => "unable to parse calendar event - event is empty" }, + ], + [ + ' mon 0 0', + { error => "unable to parse calendar event - unused parts" }, + ], + [ + '0,1,3..5', + { h => '*', m => [0,1,3,4,5], dow => $alldays }, + [ + [0, 60], + [60, 3*60], + [5*60, 60*60] + ] + ], + [ + '2,4:0,1,3..5', + { h => [2,4], m => [0,1,3,4,5], dow => $alldays }, + [ + [0, 2*60*60], + [2*60*60 + 60, 2*60*60 + 3*60], + [2*60*60 + 5*60, 4*60*60] + ] + ], ]; foreach my $test (@$tests) {