libvieter/test/cron/test_parse.c

39 lines
716 B
C

#include "acutest.h"
#include "vieter_cron.h"
void test_not_allowed() {
char *expressions[] = {
"4 *-7",
"4 *-7/4",
"4 7/*",
"0 0 30 2",
"0 /5",
"0 ",
"0",
" 0",
" 0 ",
"1 2 3 4~9",
"1 1-3-5",
"0 5/2-5",
"",
"1 1/2/3",
"*5 8",
"x 8",
NULL
};
int i = 0;
while (expressions[i] != NULL) {
vieter_cron_expression out;
TEST_CHECK_(vieter_cron_expr_parse(&out, expressions[i]) != vieter_cron_parse_ok, "%s should error", expressions[i]);
i++;
}
}
TEST_LIST = {
{"not_allowed", test_not_allowed},
{NULL, NULL}
};