[gnome-calendar/gnome-3-36] event: Add more range test cases
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gnome-3-36] event: Add more range test cases
- Date: Thu, 16 Apr 2020 19:57:02 +0000 (UTC)
commit b3556d4c50c62525dbda7b34ef7a099f55b5aa27
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]