[gnome-calendar] event: Add more range test cases
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] event: Add more range test cases
- Date: Tue, 14 Apr 2020 21:09:34 +0000 (UTC)
commit f1d20126dcb32cd44354dc623690190dd7e87cd9
Author: Clarissa Borges <clarissalimab08 gmail com>
Date: Mon Apr 13 22:40:37 2020 -0300
event: Add more range test cases
More examples of possible dates for events were added to the test cases.
Superset, subset, intersection and no overlap cases are covered.
tests/test-range.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
---
diff --git a/tests/test-range.c b/tests/test-range.c
index 145cf426..68d454d5 100644
--- a/tests/test-range.c
+++ b/tests/test-range.c
@@ -92,6 +92,60 @@ static struct {
GCAL_RANGE_MATCH,
},
+ /* Superset */
+ {
+ { "2020-03-05T00:00:00", "2020-03-10T00:00:00" },
+ { "2020-03-05T00:00:00", "2020-03-08T00:00:00" },
+ GCAL_RANGE_SUPERSET,
+ GCAL_RANGE_AFTER,
+ },
+ {
+ { "2020-03-05T00:00:00", "2020-03-10T00:00:00" },
+ { "2020-03-07T00:00:00", "2020-03-08T00:00:00" },
+ GCAL_RANGE_SUPERSET,
+ GCAL_RANGE_BEFORE,
+ },
+ {
+ { "2020-03-05T00:00:00", "2020-03-10T00:00:00" },
+ { "2020-03-07T00:00:00", "2020-03-10T00:00:00" },
+ GCAL_RANGE_SUPERSET,
+ GCAL_RANGE_BEFORE,
+ },
+
+ /* Subset */
+ {
+ { "2020-03-05T00:00:00", "2020-03-08T00:00:00" },
+ { "2020-03-05T00:00:00", "2020-03-10T00:00:00" },
+ GCAL_RANGE_SUBSET,
+ GCAL_RANGE_BEFORE,
+ },
+ {
+ { "2020-03-07T00:00:00", "2020-03-08T00:00:00" },
+ { "2020-03-05T00:00:00", "2020-03-10T00:00:00" },
+ GCAL_RANGE_SUBSET,
+ GCAL_RANGE_AFTER,
+ },
+ {
+ { "2020-03-07T00:00:00", "2020-03-10T00:00:00" },
+ { "2020-03-05T00:00:00", "2020-03-10T00:00:00" },
+ GCAL_RANGE_SUBSET,
+ GCAL_RANGE_AFTER,
+ },
+
+ /* Intersection */
+ {
+ { "2020-03-05T00:00:00", "2020-03-08T00:00:00" },
+ { "2020-03-07T00:00:00", "2020-03-10T00:00:00" },
+ GCAL_RANGE_INTERSECTS,
+ GCAL_RANGE_BEFORE,
+ },
+ {
+ { "2020-03-07T00:00:00", "2020-03-10T00:00:00" },
+ { "2020-03-05T00:00:00", "2020-03-08T00:00:00" },
+ GCAL_RANGE_INTERSECTS,
+ GCAL_RANGE_AFTER,
+ },
+
/* No Overlap */
{
{ "2020-03-05T00:00:00", "2020-03-10T00:00:00" },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]