diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/xml/document/xml-textreader_ut.cpp | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/xml/document/xml-textreader_ut.cpp')
-rw-r--r-- | library/cpp/xml/document/xml-textreader_ut.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/library/cpp/xml/document/xml-textreader_ut.cpp b/library/cpp/xml/document/xml-textreader_ut.cpp index 2cd0be96bc..6232dfe47e 100644 --- a/library/cpp/xml/document/xml-textreader_ut.cpp +++ b/library/cpp/xml/document/xml-textreader_ut.cpp @@ -20,26 +20,26 @@ namespace { while (reader.Read()) { if (reader.GetNodeType() == NXml::TTextReader::ENodeType::Element && reader.GetLocalName() == localName && - reader.GetNamespaceUri() == namespaceUri) - { + reader.GetNamespaceUri() == namespaceUri) + { const NXml::TConstNode node = reader.Expand(); nodeHandlerFunc(node); } } } -} +} Y_UNIT_TEST_SUITE(TestXmlTextReader) { Y_UNIT_TEST(BasicExample) { const TString xml = "<?xml version=\"1.0\"?>\n" - "<example toto=\"1\">\n" - " <examplechild id=\"1\">\n" - " <child_of_child/>\n" - " </examplechild>\n" - " <examplechild id=\"2\" toto=\"3\">\n" - " <child_of_child>Some content : -)</child_of_child>\n" - " </examplechild>\n" - "</example>\n"; + "<example toto=\"1\">\n" + " <examplechild id=\"1\">\n" + " <child_of_child/>\n" + " </examplechild>\n" + " <examplechild id=\"2\" toto=\"3\">\n" + " <child_of_child>Some content : -)</child_of_child>\n" + " </examplechild>\n" + "</example>\n"; TStringInput input(xml); NXml::TTextReader reader(input); @@ -94,7 +94,7 @@ Y_UNIT_TEST_SUITE(TestXmlTextReader) { TItem{2, ENT::SignificantWhitespace, "#text", "", "\n "}, TItem{1, ENT::EndElement, "examplechild", "id: 2, toto: 3", ""}, TItem{1, ENT::SignificantWhitespace, "#text", "", "\n"}, - TItem{0, ENT::EndElement, "example", "toto: 1", ""}}; + TItem{0, ENT::EndElement, "example", "toto: 1", ""}}; UNIT_ASSERT_VALUES_EQUAL(found.size(), expected.size()); @@ -108,31 +108,31 @@ Y_UNIT_TEST_SUITE(TestXmlTextReader) { } const TString GEODATA = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" - "<root>" - "" - " <country id=\"225\">" - " <name>Россия</name>" - " <cities>" - " <city>Москва</city>" - " <city>Санкт-Петербург</city>" - " </cities>" - " </country>" - "" - " <country id=\"149\">" - " <name>Беларусь</name>" - " <cities>" - " <city>Минск</city>" - " </cities>" - " </country>" - "" - " <country id=\"187\">" - " <name>Украина</name>" - " <cities>" - " <city>Киев</city>" - " </cities>" - " </country>" - "" - "</root>"; + "<root>" + "" + " <country id=\"225\">" + " <name>Россия</name>" + " <cities>" + " <city>Москва</city>" + " <city>Санкт-Петербург</city>" + " </cities>" + " </country>" + "" + " <country id=\"149\">" + " <name>Беларусь</name>" + " <cities>" + " <city>Минск</city>" + " </cities>" + " </country>" + "" + " <country id=\"187\">" + " <name>Украина</name>" + " <cities>" + " <city>Киев</city>" + " </cities>" + " </country>" + "" + "</root>"; Y_UNIT_TEST(ParseXmlSimple) { struct TCountry { @@ -253,10 +253,10 @@ Y_UNIT_TEST_SUITE(TestXmlTextReader) { Y_UNIT_TEST(NamespaceHell) { using TNS = NXml::TNamespaceForXPath; - const NXml::TNamespacesForXPath ns = { + const NXml::TNamespacesForXPath ns = { TNS{"b", "http://maps.yandex.ru/backa/1.x"}, TNS{"gml", "http://www.opengis.net/gml"}, - TNS{"xal", "urn:oasis:names:tc:ciq:xsdschema:xAL:2.0"}}; + TNS{"xal", "urn:oasis:names:tc:ciq:xsdschema:xAL:2.0"}}; int count = 0; THashMap<TString, TString> positions; |