feat: add occurrence-aware appointment search

This commit is contained in:
2026-07-18 08:31:09 +01:00
parent c19098004e
commit 2774087d14
14 changed files with 485 additions and 11 deletions

View File

@@ -155,6 +155,34 @@ void test_event_queries()
"invalid backwards event never overlaps");
}
void test_event_search()
{
nocal::Event event;
event.title = "Quarterly Planning";
event.description = "Review the launch checklist";
event.location = "North Conference Room";
event.calendar_id = "TEAM-OPERATIONS";
check(nocal::event_matches_query(event, "quarterly"),
"event search matches the title case-insensitively");
check(nocal::event_matches_query(event, "launch check"),
"event search matches a description substring");
check(nocal::event_matches_query(event, "conference"),
"event search matches a location substring");
check(nocal::event_matches_query(event, "team-operations"),
"event search matches the calendar ID case-insensitively");
check(!nocal::event_matches_query(event, ""),
"an empty event search query matches nothing");
check(!nocal::event_matches_query(event, "budget"),
"event search rejects text absent from every searchable field");
event.title = "Caf\xC3\xA9 REVIEW";
check(nocal::event_matches_query(event, "Caf\xC3\xA9 review"),
"event search preserves non-ASCII bytes while folding ASCII");
check(!nocal::event_matches_query(event, "CAF\xC3\x89"),
"event search does not locale-fold non-ASCII bytes");
}
void test_daily_dst_recurrence()
{
using namespace std::chrono;
@@ -378,6 +406,7 @@ int main()
test_dates();
test_month_layout();
test_event_queries();
test_event_search();
test_daily_dst_recurrence();
test_floating_dst_and_until();
test_weekly_count_and_exdates();