2016-04-13 23:39:22 +02:00
|
|
|
/** @file
|
2015-01-13 22:55:33 +01:00
|
|
|
* @author Edouard DUPIN
|
|
|
|
*
|
|
|
|
* @copyright 2014, Edouard DUPIN, all right reserved
|
|
|
|
*
|
|
|
|
* @license APACHE v2.0 (see license file)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "exmlTestCommon.h"
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
|
2016-04-13 23:39:22 +02:00
|
|
|
|
|
|
|
TEST(TestParseAttribute, testBase) {
|
2015-01-13 22:55:33 +01:00
|
|
|
exmlLocalTest("<elementtt attr=\"plop\"/>\n",
|
|
|
|
"<elementtt attr=\"plop\"/>\n",
|
|
|
|
-1);
|
|
|
|
}
|
2016-04-13 23:39:22 +02:00
|
|
|
TEST(TestParseAttribute, testNoQuote) {
|
2015-01-13 22:55:33 +01:00
|
|
|
exmlLocalTest("<elementtt attr=\"plop\"/>\n",
|
|
|
|
"<elementtt attr=plop/>\n",
|
|
|
|
-1);
|
|
|
|
}
|
2016-04-13 23:39:22 +02:00
|
|
|
TEST(TestParseAttribute, testNoQuoteNumber) {
|
2015-01-13 22:55:33 +01:00
|
|
|
exmlLocalTest("<elementtt attr=\"234345@3452345_.'\"/>\n",
|
|
|
|
"<elementtt attr=234345@3452345_.' />\n",
|
|
|
|
-1);
|
|
|
|
}
|
2016-04-13 23:39:22 +02:00
|
|
|
TEST(TestParseAttribute, testSpace1) {
|
2015-01-13 22:55:33 +01:00
|
|
|
exmlLocalTest("<elementtt attr=\"plop\"/>\n",
|
|
|
|
"<elementtt attr =\"plop\"/>\n",
|
|
|
|
-1);
|
|
|
|
}
|
2016-04-13 23:39:22 +02:00
|
|
|
TEST(TestParseAttribute, testSpace2) {
|
2015-01-13 22:55:33 +01:00
|
|
|
exmlLocalTest("<elementtt attr=\"plop\"/>\n",
|
|
|
|
"<elementtt attr= \"plop\"/>\n",
|
|
|
|
-1);
|
|
|
|
}
|
2016-04-13 23:39:22 +02:00
|
|
|
TEST(TestParseAttribute, testMultiline) {
|
2015-01-13 22:55:33 +01:00
|
|
|
exmlLocalTest("<elementtt attr=\"plop\"/>\n",
|
|
|
|
"<elementtt attr\n=\n\"plop\"/>\n",
|
|
|
|
-1);
|
|
|
|
}
|
2016-04-13 23:39:22 +02:00
|
|
|
TEST(TestParseAttribute, testMultilineNoQuote) {
|
2015-01-13 22:55:33 +01:00
|
|
|
exmlLocalTest("<elementtt attr=\"plop\"/>\n",
|
|
|
|
"<elementtt attr \n = \n\t plop/>\n",
|
|
|
|
-1);
|
|
|
|
}
|
2016-04-13 23:39:22 +02:00
|
|
|
TEST(TestParseAttribute, testEmptyAttribute) {
|
2015-01-13 22:55:33 +01:00
|
|
|
exmlLocalTest("<elementtt attr=\"\"/>\n",
|
|
|
|
"<elementtt attr=\"\"/>\n",
|
|
|
|
-1);
|
|
|
|
}
|
2016-04-13 23:39:22 +02:00
|
|
|
TEST(TestParseAttribute, testEmptyAttributeNoQuote) {
|
2015-01-13 22:55:33 +01:00
|
|
|
exmlLocalTest("<elementtt attr=\"\"/>\n",
|
|
|
|
"<elementtt attr=/>\n",
|
|
|
|
-1);
|
|
|
|
}
|
2016-04-13 23:39:22 +02:00
|
|
|
|
|
|
|
TEST(TestParseAttribute, testEndAttributeError) {
|
|
|
|
exmlLocalTest("",
|
|
|
|
"<elementtt attr",
|
|
|
|
1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST(TestParseAttribute, testEndAttributeErrorMissingEqual) {
|
|
|
|
exmlLocalTest("",
|
|
|
|
"<elementtt attr \"kjlkj\"/>\n",
|
|
|
|
1);
|
|
|
|
}
|