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

Add regexp test which failed

parent 11dadb91
require "regex";
# Try to catch unsolicited email.
if anyof (
# if a message is not to me (with optional +detail),
not address :regex ["to", "cc", "bcc"]
"me(\\\\+.*)?@company\\\\.com",
# or the subject is all uppercase (no lowercase)
header :regex :comparator "i;octet" "subject"
"^[^[:lower:]]+$" ) {
discard; # junk it
}
require "regex";
# Try to catch unsolicited email.
if anyof (
# if a message is not to me (with optional +detail),
not address :regex ["to", "cc", "bcc"]
"me(\\\\+.*)?@company\\\\.com",
# or the subject is all uppercase (no lowercase)
header :regex :comparator "i;octet" "subject"
"^[^[:lower:]]+$" ) {
discard; # junk it
}
......@@ -91,6 +91,7 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts()
proc.start(QStringLiteral("diff"), args);
QVERIFY(proc.waitForFinished());
QEXPECT_FAIL("regexp" , "Expected failure on regexp file. Problem with header + comparator", Continue);
QEXPECT_FAIL("test-current-date" , "Expected failure on delete-headers file", Continue);
QCOMPARE(proc.exitCode(), 0);
}
......@@ -152,6 +153,8 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data()
QTest::newRow("vacation-active-discard") << QStringLiteral("vacation-active-discard") << false << true;
QTest::newRow("vacation-multiple") << QStringLiteral("vacation-multiple") << false << true;
QTest::newRow("full-example1") << QStringLiteral("full-example1") << false << true;
//We need to fix it.
QTest::newRow("regexp") << QStringLiteral("regexp") << true << true;
}
......
......@@ -367,6 +367,9 @@ void SieveConditionWidgetLister::loadScript(const QDomElement &e, bool uniqTest,
}
} else if (testTagName == QLatin1String("crlf")) {
//nothing
} else if (testTagName == QLatin1String("comment")) {
//nothing
//implement in the future ?
} else {
qCDebug(LIBKSIEVE_LOG) << " SieveConditionWidgetLister::loadScript unknown condition tag: " << testTagName;
}
......
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