Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: tools/gn/xml_element_writer_unittest.cc

Issue 2813213002: Moved/renamed EscapeString from visual_studio_writer to XmlEscape in xml_element_writer. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/xml_element_writer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/xml_element_writer_unittest.cc
diff --git a/tools/gn/xml_element_writer_unittest.cc b/tools/gn/xml_element_writer_unittest.cc
index 93dfd47585130b5df9fa0e443519f37da7a33458..cc21c4bb66c62ae50804416b70f55aff3addccba 100644
--- a/tools/gn/xml_element_writer_unittest.cc
+++ b/tools/gn/xml_element_writer_unittest.cc
@@ -84,3 +84,10 @@ TEST(XmlElementWriter, StartContent) {
}
EXPECT_EQ("<foo bar=\"baz\">Hello world!</foo>\n", out.str());
}
+
+TEST(XmlElementWriter, TestXmlEscape) {
+ std::string input = "\r \n \t & < > \"";
+ std::string output = XmlEscape(input);
+ std::string expected = "&#13; &#10; &#9; &amp; &lt; &gt; &quot;";
+ EXPECT_EQ(expected, output);
+}
« no previous file with comments | « tools/gn/xml_element_writer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698