mod test_helpers; use anyhow::Result; use test_helpers::assert_round_trip; use vcard4::{parse_loose, property::Kind}; #[test] fn loose() -> Result<()> { let input = r#"BEGIN:VCARD VERSION:4.0 FN:Jane Doe KIND:org KIND:individual END:VCARD"#; // By using parse loose it ignores the error that is // generated by having multiple KIND properties let mut vcards = parse_loose(input)?; assert_eq!(1, vcards.len()); let card = vcards.remove(0); assert_eq!(Kind::Org, card.kind.as_ref().unwrap().value); assert_round_trip(&card)?; Ok(()) }