39 lines
745 B
C
39 lines
745 B
C
#include "acutest.h"
|
|
#include "vieter_cron.h"
|
|
|
|
void test_illegal_expressions() {
|
|
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 = {
|
|
{"cron illegal expressions", test_illegal_expressions},
|
|
{NULL, NULL}
|
|
};
|