Commit 988c0d2f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add autotest

parent 498022a6
......@@ -27,7 +27,22 @@ TemplateParserUtilTest::TemplateParserUtilTest(QObject *parent)
}
void TemplateParserUtilTest::shouldHaveDefaultValues()
void TemplateParserUtilTest::shouldRemoveSpaceAtBegin_data()
{
//TODO
QTest::addColumn<QString>("selection");
QTest::addColumn<QString>("cleanedString");
QTest::newRow("empty") << QString() << QString();
QTest::newRow("tabatbegin") << QStringLiteral("\t\t foo") << QStringLiteral("\t\t foo");
QTest::newRow("newlinetabatbegin") << QStringLiteral("\n\n\n\n\t\t foo") << QStringLiteral("\n\t\t foo");
QTest::newRow("newlinetabatbeginwithspace") << QStringLiteral(" \n\n\n\n\t\t foo") << QStringLiteral("\n\t\t foo");
QTest::newRow("newlinetabatbeginwithspace2") << QStringLiteral(" \n \n\n\n\t\t foo") << QStringLiteral("\n\t\t foo");
QTest::newRow("newlinetabatbeginwithspace3") << QStringLiteral("ddd \n \n\n\n\t\t foo") << QStringLiteral("ddd \n \n\n\n\t\t foo");
QTest::newRow("newlinetabatbeginwithspace4") << QStringLiteral(" ddd \n \n\n\n\t\t foo") << QStringLiteral(" ddd \n \n\n\n\t\t foo");
}
void TemplateParserUtilTest::shouldRemoveSpaceAtBegin()
{
QFETCH(const QString, selection);
QFETCH(const QString, cleanedString);
QCOMPARE(TemplateParser::Util::removeSpaceAtBegin(selection), cleanedString);
}
......@@ -29,7 +29,8 @@ public:
~TemplateParserUtilTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValues();
void shouldRemoveSpaceAtBegin_data();
void shouldRemoveSpaceAtBegin();
};
#endif // TEMPLATEPARSERUTILTEST_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment