Commit 04e464fa authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add new autotest. It will help us to port to qregularexpression

parent 4d23c0a2
......@@ -472,6 +472,7 @@ void TemplateParserJobTest::test_processWithTemplatesForContent_data()
//Header doesn't exist => don't add value
QTest::newRow("%OHEADER=\"SSS\"") << "%HEADER=\"SSS\"" << fileName << "" << false;
QTest::newRow("%OHEADER=\"To\"") << "%OHEADER=\"To\"" << fileName << "kde <foo@yoohoo.org>" << false;
QTest::newRow("%HEADER( To )") << "%HEADER( To )" << fileName << "kde <foo@yoohoo.org>" << false;
//Unknown command
QTest::newRow("unknown command") << "%GGGGG" << fileName << "%GGGGG" << false;
......
......@@ -694,7 +694,7 @@ void TemplateParserJob::slotExtractInfoDone(const TemplateParserExtractHtmlInfoR
i += strlen("HEADER( ");
} else {
i += re.matchedLength();
const QString hdr = re.cap(1);
const QString hdr = re.cap(1).trimmed();
QString str;
if (auto hrdMsgOrigin = d->mOrigMsg->headerByType(hdr.toLocal8Bit().constData())) {
str = hrdMsgOrigin->asUnicodeString();
......
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