From 4638cf9712a02bce009430e82a15be07c2fff731 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Sun, 8 Sep 2024 22:02:07 +0200 Subject: [PATCH] test: add another escaping test --- src/properties.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/properties.rs b/src/properties.rs index 76d2756..07cae81 100644 --- a/src/properties.rs +++ b/src/properties.rs @@ -34,6 +34,12 @@ impl Parameter { } } +impl From<(&str, &str)> for Parameter { + fn from((key, val): (&str, &str)) -> Self { + Parameter::new(key, val) + } +} + //type EntryParameters = Vec; pub type EntryParameters = HashMap; @@ -453,7 +459,7 @@ mod tests { let expected = r"\N\\\;\,:"; let prop = Property::new("DESCRIPTION", line) - .append_parameter(Parameter::new("VALUE", "TEXT")) + .append_parameter(("VALUE", "TEXT")) .done(); let expected = format!("DESCRIPTION;VALUE=TEXT:{expected}\r\n");