diff options
author | Ken Murchison <murch@fastmail.com> | 2019-06-06 13:52:51 -0400 |
---|---|---|
committer | Ken Murchison <murch@fastmail.com> | 2019-06-06 13:52:51 -0400 |
commit | ee5085ae06250e4878810b77d220d1901e77caba (patch) | |
tree | 3ded825d553df126e1318a5753ce8bee4c998083 | |
parent | afb45d49095e0fa09f5d28cd644b68107704e54e (diff) | |
download | libical-git-rrule_until+count.tar.gz |
regression.c: Added tests for UNTIL + COUNTrrule_until+count
-rw-r--r-- | src/test/regression.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/regression.c b/src/test/regression.c index 756198e2..f49e63bf 100644 --- a/src/test/regression.c +++ b/src/test/regression.c @@ -2672,6 +2672,8 @@ void test_time_parser() void test_recur_parser() { struct icalrecurrencetype rt; + icalvalue *v = NULL; + icalerrorstate es; const char *str; str = @@ -2683,6 +2685,25 @@ void test_recur_parser() rt = icalrecurrencetype_from_string(str); str_is(str, icalrecurrencetype_as_string(&rt), str); + + /* Add UNTIL and make sure we output a NULL string */ + rt.until = icaltime_today(); + ok("COUNT + UNTIL not allowed", icalrecurrencetype_as_string(&rt) == NULL); + + /* Try to create a new RRULE value with UNTIL + COUNT */ + es = icalerror_supress("BADARG"); + v = icalvalue_new_recur(rt); + rt = icalvalue_get_recur(v); + icalerror_restore("BADARG", es); + ok("COUNT + UNTIL not allowed", rt.freq == ICAL_NO_RECURRENCE); + + /* Try to parse an RRULE value with UNTIL + COUNT */ + str = "FREQ=YEARLY;UNTIL=20000131T090000Z;COUNT=3"; + + es = icalerror_supress("MALFORMEDDATA"); + rt = icalrecurrencetype_from_string(str); + icalerror_restore("MALFORMEDDATA", es); + ok(str, rt.freq == ICAL_NO_RECURRENCE); } |