diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-24 17:38:52 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-24 17:38:52 +0200 |
| commit | cfd96a07b5b14abe1585f0edf68cd0b9c8975463 (patch) | |
| tree | 2e8c613af723f5b3a60e9a345ac29c85ea06f837 /tests | |
| parent | 516b2daaeab00bb4d4c28055a434dc5ee53aeb60 (diff) | |
| download | qtmaildir-cfd96a07b5b14abe1585f0edf68cd0b9c8975463.tar.gz qtmaildir-cfd96a07b5b14abe1585f0edf68cd0b9c8975463.zip | |
docs: document the calendar, translate it, file its follow-ups
Give RepeatRule its own Q_DECLARE_TR_FUNCTIONS context so lupdate extracts
describe() and the ordinal words, mirroring the array's QT_TRANSLATE_NOOP;
without it lupdate warned and RepeatRule/last was never extractable.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_calendarstore.cpp | 20 |
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" |
