aboutsummaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
authorKevin Ballard2018-05-16 14:30:28 -0700
committerEd Barnard2018-05-16 23:07:03 +0100
commit780dfc6eaff7351402d9094ef3e432ffaba2b0ce (patch)
treef4c119068fc01527a2761d69f5c99da29563f908 /src/xml
parent45ab6d492c1a031485962e17d2af932d8af069d8 (diff)
downloadrust-plist-780dfc6eaff7351402d9094ef3e432ffaba2b0ce.tar.bz2
Add a test to ensure string data is entity-escaped
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/writer.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xml/writer.rs b/src/xml/writer.rs
index 4facfd2..e002e55 100644
--- a/src/xml/writer.rs
+++ b/src/xml/writer.rs
@@ -213,6 +213,8 @@ mod tests {
DataValue(vec![0, 0, 0, 190, 0, 0, 0, 3, 0, 0, 0, 30, 0, 0, 0]),
StringValue("Birthdate".to_owned()),
DateValue(parse_rfc3339_weak("1981-05-16 11:32:06").unwrap().into()),
+ StringValue("Comment".to_owned()),
+ StringValue("2 < 3".to_owned()), // make sure characters are escaped
EndDictionary,
];
@@ -245,6 +247,8 @@ mod tests {
\t<data>AAAAvgAAAAMAAAAeAAAA</data>
\t<key>Birthdate</key>
\t<date>1981-05-16T11:32:06Z</date>
+\t<key>Comment</key>
+\t<string>2 &lt; 3</string>
</dict>
</plist>";