aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_calendarstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_calendarstore.cpp')
-rw-r--r--tests/test_calendarstore.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_calendarstore.cpp b/tests/test_calendarstore.cpp
index e492bfb..524304e 100644
--- a/tests/test_calendarstore.cpp
+++ b/tests/test_calendarstore.cpp
@@ -158,6 +158,8 @@ private slots:
void editingTheSameOccurrenceAgainReplacesItsOverride();
void deletingOneOccurrenceAddsAnExdateAndDropsItsOverride();
void deletingOneOccurrenceKeepsExistingExdates();
+
+ void theLiveVdirLoadsCleanly();
};
void TestCalendarStore::parsesAUtcEvent()
@@ -680,5 +682,23 @@ void TestCalendarStore::deletingOneOccurrenceKeepsExistingExdates()
QCOMPARE(CalendarStore::occurrences({ e }, rome(21, 0), rome(26, 0)).size(), 3);
}
+void TestCalendarStore::theLiveVdirLoadsCleanly()
+{
+ // Opt-in, READ-ONLY: never writes. Run by hand before handing the build
+ // over: QTMAILDIR_LIVE_CALENDARS=~/.local/share/calendars ./test_calendarstore
+ const QString dir = qEnvironmentVariable("QTMAILDIR_LIVE_CALENDARS");
+ if (dir.isEmpty())
+ QSKIP("QTMAILDIR_LIVE_CALENDARS not set");
+ const LoadResult r = CalendarStore::load(dir);
+ qInfo("collections=%lld events=%lld unparsable=%d unknownZones=%d",
+ qlonglong(r.collections.size()), qlonglong(r.events.size()),
+ r.unparsable, r.unknownZones);
+ QCOMPARE(r.unparsable, 0);
+ const QList<Occurrence> year = CalendarStore::occurrences(
+ r.events, QDateTime(QDate(2026, 1, 1), QTime(0, 0)),
+ QDateTime(QDate(2027, 1, 1), QTime(0, 0)));
+ qInfo("occurrences in 2026=%lld", qlonglong(year.size()));
+}
+
QTEST_MAIN(TestCalendarStore)
#include "test_calendarstore.moc"