MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / compareXMLFragments

Function compareXMLFragments

test/XmlUtil.cpp:222–229  ·  view source on GitHub ↗

pugixml does not guarantee to preserve formatting in the output, so we instead break the XML into non-whitespace fragments and compare these one by one.

Source from the content-addressed store, hash-verified

220 // pugixml does not guarantee to preserve formatting in the output, so we instead break
221 // the XML into non-whitespace fragments and compare these one by one.
222 void compareXMLFragments(const std::string& actual, const std::string& expected)
223 {
224 auto actFrags = string::splitToVec(actual, " \n\r\t<>");
225 auto expFrags = string::splitToVec(expected, " \n\r\t<>");
226
227 EXPECT_EQ(actFrags.size(), expFrags.size());
228 EXPECT_EQ(actFrags, expFrags);
229 }
230}
231
232TEST_F(XmlTest, SaveDocumentToFile)

Callers 1

TEST_FFunction · 0.85

Calls 2

splitToVecFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected