Commit a32b3dcd authored by Laurent Montel's avatar Laurent Montel 😁

Fix more bug. Add autotest for it

parent 7c111188
require "reject";
#SCRIPTNAME: test
reject text:
test \"too\"
.
;
require "reject";
#SCRIPTNAME: test
reject text:
test \"too\"
.
;
...@@ -232,6 +232,8 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data() ...@@ -232,6 +232,8 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data()
QTest::newRow("test-header-multilist-comment") << QStringLiteral("test-header-multilist-comment") << false << true; QTest::newRow("test-header-multilist-comment") << QStringLiteral("test-header-multilist-comment") << false << true;
QTest::newRow("wierd-script") << QStringLiteral("wierd-script") << false << true; QTest::newRow("wierd-script") << QStringLiteral("wierd-script") << false << true;
QTest::newRow("test-text-with-backslash") << QStringLiteral("test-text-with-backslash") << false << true;
} }
QTEST_MAIN(SieveEditorGraphicalModeWidgetTest) QTEST_MAIN(SieveEditorGraphicalModeWidgetTest)
...@@ -57,7 +57,7 @@ bool SieveActionEReject::setParamWidgetValue(QXmlStreamReader &element, QWidget ...@@ -57,7 +57,7 @@ bool SieveActionEReject::setParamWidgetValue(QXmlStreamReader &element, QWidget
if (tagName == QLatin1String("str")) { if (tagName == QLatin1String("str")) {
const QString tagValue = element.readElementText(); const QString tagValue = element.readElementText();
MultiLineEdit *edit = w->findChild<MultiLineEdit *>(QStringLiteral("rejectmessage")); MultiLineEdit *edit = w->findChild<MultiLineEdit *>(QStringLiteral("rejectmessage"));
edit->setPlainText(AutoCreateScriptUtil::quoteStr(tagValue)); edit->setPlainText(tagValue);
} else if (tagName == QLatin1String("crlf")) { } else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement(); element.skipCurrentElement();
//nothing //nothing
......
...@@ -57,7 +57,7 @@ bool SieveActionReject::setParamWidgetValue(QXmlStreamReader &element, QWidget * ...@@ -57,7 +57,7 @@ bool SieveActionReject::setParamWidgetValue(QXmlStreamReader &element, QWidget *
if (tagName == QLatin1String("str")) { if (tagName == QLatin1String("str")) {
const QString tagValue = element.readElementText(); const QString tagValue = element.readElementText();
MultiLineEdit *edit = w->findChild<MultiLineEdit *>(QStringLiteral("rejectmessage")); MultiLineEdit *edit = w->findChild<MultiLineEdit *>(QStringLiteral("rejectmessage"));
edit->setPlainText(AutoCreateScriptUtil::quoteStr(tagValue)); edit->setPlainText(tagValue);
} else if (tagName == QLatin1String("crlf")) { } else if (tagName == QLatin1String("crlf")) {
element.skipCurrentElement(); element.skipCurrentElement();
//nothing //nothing
......
...@@ -128,7 +128,6 @@ void XMLPrintingScriptBuilderTest::shouldCreateXml_data() ...@@ -128,7 +128,6 @@ void XMLPrintingScriptBuilderTest::shouldCreateXml_data()
QTest::newRow("test-comment8") << QStringLiteral("test-comment8")<< true; QTest::newRow("test-comment8") << QStringLiteral("test-comment8")<< true;
QTest::newRow("test-comment9") << QStringLiteral("test-comment9")<< true; QTest::newRow("test-comment9") << QStringLiteral("test-comment9")<< true;
QTest::newRow("test-date1") << QStringLiteral("test-date1")<< true; QTest::newRow("test-date1") << QStringLiteral("test-date1")<< true;
} }
void XMLPrintingScriptBuilderTest::shouldCreateXml() void XMLPrintingScriptBuilderTest::shouldCreateXml()
......
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