X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ftest_html_parser.cpp;h=2b23dde1364826e875b42194ea9d3261702c1a60;hb=489bd9188aed44d93c29f996311e0477152d592a;hp=9840c1d30bad32a34560d152583cc58aa44bed13;hpb=bb6b58cbec0e41a8ba2403e540185e77882e8741;p=metaproxy-moved-to-github.git
diff --git a/src/test_html_parser.cpp b/src/test_html_parser.cpp
index 9840c1d..2b23dde 100644
--- a/src/test_html_parser.cpp
+++ b/src/test_html_parser.cpp
@@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE( test_html_parser_2 )
try
{
mp::HTMLParser hp;
- const char* html =
+ const char* html =
"\n"
"\n"
"
\n"
@@ -135,7 +135,7 @@ BOOST_AUTO_TEST_CASE( test_html_parser_2 )
std::cout << e.out << std::endl;
}
}
- catch (std::exception & e)
+ catch (std::exception & e)
{
std::cout << e.what();
std::cout << std::endl;
@@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE( test_html_parser_3 )
std::cout << e.out << std::endl;
}
}
- catch (std::exception & e)
+ catch (std::exception & e)
{
std::cout << e.what();
std::cout << std::endl;
@@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE( test_html_parser_4 )
mp::HTMLParser hp;
const char* html =
"\n"
- "";
+ "";
const char* expected = html;
MyEvent e;
@@ -241,6 +241,68 @@ BOOST_AUTO_TEST_CASE( test_html_parser_5 )
}
}
+BOOST_AUTO_TEST_CASE( test_html_parser_6 )
+{
+ try
+ {
+ mp::HTMLParser hp;
+ const char* html =
+ "";
+
+ const char* expected = html;
+ MyEvent e;
+ hp.set_verbose(0);
+ hp.parse(e, html);
+
+ BOOST_CHECK_EQUAL(std::string(expected), e.out);
+ if (std::string(expected) != e.out)
+ {
+ std::cout << "Expected" << std::endl;
+ std::cout << expected << std::endl;
+ std::cout << "Got" << std::endl;
+ std::cout << e.out << std::endl;
+ }
+ }
+ catch (std::exception & e)
+ {
+ std::cout << e.what();
+ std::cout << std::endl;
+ BOOST_CHECK (false);
+ }
+}
+
+BOOST_AUTO_TEST_CASE( test_html_parser_7 )
+{
+ try
+ {
+ mp::HTMLParser hp;
+ const char* html =
+ ""
+ "1>\nx=2;\n";
+
+ const char* expected = html;
+ MyEvent e;
+ hp.set_verbose(0);
+ hp.parse(e, html);
+
+ BOOST_CHECK_EQUAL(std::string(expected), e.out);
+ if (std::string(expected) != e.out)
+ {
+ std::cout << "Expected" << std::endl;
+ std::cout << expected << std::endl;
+ std::cout << "Got" << std::endl;
+ std::cout << e.out << std::endl;
+ }
+ }
+ catch (std::exception & e)
+ {
+ std::cout << e.what();
+ std::cout << std::endl;
+ BOOST_CHECK (false);
+ }
+}
+
/*
* Local variables: