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.
| 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 | |
| 232 | TEST_F(XmlTest, SaveDocumentToFile) |
no test coverage detected