X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ftest_html_parser.cpp;h=f0ab6416f22808d47c2cc86d626654db839b74a3;hb=f51a51c6c6e1f8c5de6e90f548df3d8dc12e00ac;hp=523011700b842079f2bdc31fbae5c07375e33226;hpb=a258482a3b53b90b0932f4a789ba66e8e1576c05;p=metaproxy-moved-to-github.git diff --git a/src/test_html_parser.cpp b/src/test_html_parser.cpp index 5230117..f0ab641 100644 --- a/src/test_html_parser.cpp +++ b/src/test_html_parser.cpp @@ -45,17 +45,19 @@ class MyEvent : public mp::HTMLParserEvent { } void attribute(const char *tagName, - const char *name, const char *value) + const char *name, const char *value, int val_len) { out += " "; out += name; out += "=\""; - out += value; + out.append(value, val_len); out += "\""; } - void anyTagEnd(const char *name) + void anyTagEnd(const char *name, int close_it) { + if (close_it) + out += "/"; out += ">"; } @@ -79,12 +81,15 @@ BOOST_AUTO_TEST_CASE( test_html_parser_1 ) mp::HTMLParser hp; const char* html = "some text" - "
"; const char* expected = "some text" - "
"; MyEvent e; hp.parse(e, html); + + std::cout << expected << std::endl; + std::cout << e.out << std::endl; BOOST_CHECK_EQUAL(std::string(expected), e.out); } catch (std::exception & e)