FIX: Adds test case for escape_xml function

This commit is contained in:
Nicolás Hatcher
2024-03-21 22:32:48 +01:00
parent 053217d3e4
commit 5be13d1602

View File

@@ -16,10 +16,9 @@ fn test_escape_xml() {
escape_xml("This is <>&\"' say"),
"This is &lt;&gt;&amp;&quot;&apos; say"
);
}
// '&' => "&amp;"
// '<' "&lt;")
// '>' => "&gt;"
// '"' => "&quot;"
// '\'' => "&apos;"
assert_eq!(
escape_xml("One line\nanother line\n\r"),
"One line&#xA;another line&#xA;&#xD;"
);
}