diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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<Vec<ical::parser: .collect()) } +fn match_event(_event: &ical::parser::ical::component::IcalEvent, _pattern: &str) -> 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()); |