summaryrefslogtreecommitdiff
path: root/test/test.cpp
diff options
context:
space:
mode:
authorGravatar Andreas Krennmair <ak@synflood.at> 2009-10-22 23:54:55 +0200
committerGravatar Andreas Krennmair <ak@synflood.at> 2009-10-22 23:55:40 +0200
commit877f67a93ffacfb0cc7256f7b255e0bb54362216 (patch)
tree10ef59d53cd8baee65bb9c55c9d4d12c90a73cc5 /test/test.cpp
parent58abaa50b1c1556a6e31084a82df5bbdbd68db8b (diff)
downloadnewsboat-877f67a93ffacfb0cc7256f7b255e0bb54362216.tar.gz
newsboat-877f67a93ffacfb0cc7256f7b255e0bb54362216.tar.zst
newsboat-877f67a93ffacfb0cc7256f7b255e0bb54362216.zip
tag soup pull parser: added support for spaces in attributes.
Diffstat (limited to 'test/test.cpp')
-rw-r--r--test/test.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/test.cpp b/test/test.cpp
index d5ad44be..b4a00926 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -180,7 +180,7 @@ BOOST_AUTO_TEST_CASE(TestConfigParserContainerAndKeymap) {
}
BOOST_AUTO_TEST_CASE(TestTagSoupPullParser) {
- std::istringstream is("<test><foo quux='asdf' bar=\"qqq\">text</foo>more text<more>&quot;&#33;&#x40;</more></test>");
+ std::istringstream is("<test><foo quux='asdf' bar=\"qqq\">text</foo>more text<more>&quot;&#33;&#x40;</more><xxx foo=bar baz=\"qu ux\" hi='ho ho ho'></xxx></test>");
tagsouppullparser xpp;
tagsouppullparser::event e;
xpp.setInput(is);
@@ -214,6 +214,15 @@ BOOST_AUTO_TEST_CASE(TestTagSoupPullParser) {
BOOST_CHECK_EQUAL(e, tagsouppullparser::END_TAG);
BOOST_CHECK_EQUAL(xpp.getText(), "more");
e = xpp.next();
+ BOOST_CHECK_EQUAL(e, tagsouppullparser::START_TAG);
+ BOOST_CHECK_EQUAL(xpp.getText(), "xxx");
+ BOOST_CHECK_EQUAL(xpp.getAttributeValue("foo"), "bar");
+ BOOST_CHECK_EQUAL(xpp.getAttributeValue("baz"), "qu ux");
+ BOOST_CHECK_EQUAL(xpp.getAttributeValue("hi"), "ho ho ho");
+ e = xpp.next();
+ BOOST_CHECK_EQUAL(e, tagsouppullparser::END_TAG);
+ BOOST_CHECK_EQUAL(xpp.getText(), "xxx");
+ e = xpp.next();
BOOST_CHECK_EQUAL(e, tagsouppullparser::END_TAG);
BOOST_CHECK_EQUAL(xpp.getText(), "test");
e = xpp.next();