Commit 6fc492e1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add autotest for loading quote

parent 190d60d6
Pipeline #44058 passed with stage
in 9 minutes and 35 seconds
...@@ -18,5 +18,27 @@ ImportKMailAutocorrectionTest::ImportKMailAutocorrectionTest(QObject *parent) ...@@ -18,5 +18,27 @@ ImportKMailAutocorrectionTest::ImportKMailAutocorrectionTest(QObject *parent)
void ImportKMailAutocorrectionTest::shouldHaveDefaultValues() void ImportKMailAutocorrectionTest::shouldHaveDefaultValues()
{ {
PimCommon::ImportKMailAutocorrection import; PimCommon::ImportKMailAutocorrection import;
//TODO QVERIFY(import.upperCaseExceptions().isEmpty());
QVERIFY(import.twoUpperLetterExceptions().isEmpty());
QVERIFY(import.autocorrectEntries().isEmpty());
QVERIFY(import.superScriptEntries().isEmpty());
QCOMPARE(import.typographicSingleQuotes().begin, QChar());
QCOMPARE(import.typographicSingleQuotes().end, QChar());
QCOMPARE(import.typographicDoubleQuotes().begin, QChar());
QCOMPARE(import.typographicDoubleQuotes().end, QChar());
QCOMPARE(import.maxFindStringLenght(), 0);
QCOMPARE(import.minFindStringLenght(), 0);
}
void ImportKMailAutocorrectionTest::shouldLoadFile()
{
const QString originalFile = QLatin1String(AUTOCORRECTION_DATA_DIR) + QStringLiteral("/custom-fr.xml");
PimCommon::ImportKMailAutocorrection import;
QVERIFY(import.import(originalFile));
QCOMPARE(import.typographicSingleQuotes().begin, QStringLiteral("‘"));
QCOMPARE(import.typographicSingleQuotes().end, QStringLiteral("’"));
QCOMPARE(import.typographicDoubleQuotes().begin, QStringLiteral("“"));
QCOMPARE(import.typographicDoubleQuotes().end, QStringLiteral("”"));
} }
...@@ -16,6 +16,7 @@ public: ...@@ -16,6 +16,7 @@ public:
~ImportKMailAutocorrectionTest() override = default; ~ImportKMailAutocorrectionTest() override = default;
private Q_SLOTS: private Q_SLOTS:
void shouldHaveDefaultValues(); void shouldHaveDefaultValues();
void shouldLoadFile();
}; };
#endif // IMPORTKMAILAUTOCORRECTIONTEST_H #endif // IMPORTKMAILAUTOCORRECTIONTEST_H
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
#include <QHash> #include <QHash>
#include "autocorrection/autocorrection.h" #include "autocorrection/autocorrection.h"
#include "pimcommon_private_export.h"
namespace PimCommon { namespace PimCommon {
class ImportAbstractAutocorrection class PIMCOMMON_TESTS_EXPORT ImportAbstractAutocorrection
{ {
Q_GADGET Q_GADGET
public: public:
......
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