summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/UnitTest')
-rw-r--r--Swiften/Parser/UnitTest/XMLParserTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Swiften/Parser/UnitTest/XMLParserTest.cpp b/Swiften/Parser/UnitTest/XMLParserTest.cpp
index b593aa7..9e9012b 100644
--- a/Swiften/Parser/UnitTest/XMLParserTest.cpp
+++ b/Swiften/Parser/UnitTest/XMLParserTest.cpp
@@ -215,10 +215,19 @@ class XMLParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(Client::EndElement, client_.events[1].type);
CPPUNIT_ASSERT_EQUAL(std::string("iq"), client_.events[1].data);
}
+ void testParse_CompleteDocument() {
+ ParserType testling(&client_);
+
+ CPPUNIT_ASSERT(!testling.parse("<iq", true));
+ CPPUNIT_ASSERT(!testling.parse("<iq>", true));
+ CPPUNIT_ASSERT(!testling.parse("<iq><child>foo</child>", true));
+ CPPUNIT_ASSERT(testling.parse("<iq><child>foo</child></iq>", true));
+ }
+
void testParse_WhitespaceInAttribute() {
ParserType testling(&client_);
CPPUNIT_ASSERT(testling.parse(
"<query xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-data '>"));