ical_rust 0.8.6

A lightweight, efficient, and robust iCalendar (ics) parser and recurrence expander library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::*;

#[test]
fn unfolded_lines_are_borrowed_and_folded_lines_are_owned() {
    let input = "BEGIN:VCALENDAR\r\nSUMMARY:Hello \r\n World\r\n\t!\r\nEND:VCALENDAR";
    let parsed: Vec<Cow<'_, str>> = ICalLineParser::new(input).collect();
    assert_eq!(parsed.len(), 3);
    assert!(matches!(parsed[0], Cow::Borrowed("BEGIN:VCALENDAR")));
    assert!(matches!(parsed[1], Cow::Owned(_)));
    assert_eq!(parsed[1], "SUMMARY:Hello World!");
    assert!(matches!(parsed[2], Cow::Borrowed("END:VCALENDAR")));
}