Commit 5a7d5823 authored by Laurent Montel's avatar Laurent Montel 😁

Add more autotest

parent 00d84caf
......@@ -47,7 +47,14 @@ void GrammalecteGrammarErrorTest::shouldParseJson_data()
QTest::addColumn<int>("nbBlock");
QTest::addColumn<GrammalecteGrammarError>("error");
QTest::newRow("empty-error") << QStringLiteral("empty-error") << 1 << GrammalecteGrammarError();
QTest::newRow("error1") << QStringLiteral("error1") << 1 << GrammalecteGrammarError();
GrammalecteGrammarError err;
err.setBlockId(1);
err.setBegin(15);
err.setEnd(20);
err.setColor(QColor(217,128,38));
err.setSuggestions(QStringList() << QStringLiteral("Alors"));
err.setError(QStringLiteral("Après un point, une majuscule est généralement requise."));
QTest::newRow("error1") << QStringLiteral("error1") << 1 << err;
}
void GrammalecteGrammarErrorTest::shouldParseJson()
......
......@@ -128,7 +128,7 @@ QStringList GrammalecteGrammarError::parseSuggestion(const QJsonObject &obj)
const QJsonArray array = obj[QStringLiteral("aSuggestions")].toArray();
const QVariantList list = array.toVariantList();
for (const QVariant &v : list) {
qDebug() << " v" << v.toString();
//qDebug() << " v" << v.toString();
lst.append(v.toString());
}
return lst;
......
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