From 9925eeefbe864b81b96dffdb67b69b2572eca679 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 18 Dec 2018 13:15:24 +0100 Subject: Add minimal function to match all events. --- src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index af10ccb..28575d5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,6 +62,18 @@ fn read_icalendar_from_file(filename: &str) -> std::io::Result bool { + true +} + +#[test] +fn match_all_events() { + let cal = read_icalendar_from_file("test/fixtures/events.ics").unwrap(); + let num_events = cal[0].events.len(); + let events:Vec<_> = cal[0].events.iter().filter(|ref event| match_event(&event, "*")).collect(); + assert_eq!(num_events, events.len()); +} + fn main() { let calendars = read_icalendar_from_file("test.ics").unwrap(); println!("Found {} calendard in file...", calendars.len()); -- cgit v1.2.3