Commit 46e8795a authored by Laurent Montel's avatar Laurent Montel 😁

Add more autotest

parent a2d46a00
...@@ -80,9 +80,19 @@ void UtilTest::shouldTestHasMissingAttachment_data() ...@@ -80,9 +80,19 @@ void UtilTest::shouldTestHasMissingAttachment_data()
QTest::addColumn<QString>("body"); QTest::addColumn<QString>("body");
QTest::addColumn<bool>("hasMissingAttachment"); QTest::addColumn<bool>("hasMissingAttachment");
QStringList lstDefaultAttachement{QStringLiteral("attachment"), QStringLiteral("att:")}; QStringList lstDefaultAttachement{QStringLiteral("attachment"), QStringLiteral("att2")};
QTest::newRow("emptybody") << lstDefaultAttachement << QStringLiteral("foo") << QString() << false; QTest::newRow("emptybody") << lstDefaultAttachement << QStringLiteral("foo") << QString() << false;
QTest::newRow("emptybodyandsubject") << lstDefaultAttachement << QString() << QString() << false; QTest::newRow("emptybodyandsubject") << lstDefaultAttachement << QString() << QString() << false;
QTest::newRow("subjectwithattachmentkeyword") << lstDefaultAttachement << QStringLiteral("attachment foo") << QString() << true;
QTest::newRow("subjectwithattachmentkeywordonly") << lstDefaultAttachement << QStringLiteral("attachment") << QString() << true;
QTest::newRow("subjectwithattachmentkeywordbutreply") << lstDefaultAttachement << QStringLiteral("Re: attachment") << QString() << false;
QTest::newRow("subjectwithattachmentkeywordbutreplywithoutattachement") << lstDefaultAttachement << QStringLiteral("Re: attachment") << QStringLiteral("foo bla\n bli") << false;
QTest::newRow("subjectwithattachmentkeywordbutreplywithattachement") << lstDefaultAttachement << QStringLiteral("Re: attachment") << QStringLiteral("foo bla\n attachment:") << true;
QTest::newRow("subjectwithattachmentkeywordbutreplywithattachement2") << lstDefaultAttachement << QStringLiteral("Re: attachment") << QStringLiteral("foo bla att2\n bli:") << true;
QTest::newRow("excludequotedstr") << lstDefaultAttachement << QStringLiteral("Re: attachment") << QStringLiteral("> foo bla att2\n bli:") << false;
QTest::newRow("excludequotedstr2") << lstDefaultAttachement << QStringLiteral("Re: attachment") << QStringLiteral("> foo bla att2\n att2:") << true;
QTest::newRow("excludequotedstr3") << lstDefaultAttachement << QStringLiteral("Re: attachment") << QStringLiteral("| foo bla att2\n att2:") << true;
QTest::newRow("subjectwithattachmentkeywordbutforward") << lstDefaultAttachement << QStringLiteral("Fwd: attachment") << QString() << false;
} }
void UtilTest::shouldTestHasMissingAttachment() void UtilTest::shouldTestHasMissingAttachment()
......
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