summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-05-15 22:24:38 +0200
committerMontel Laurent <[email protected]>2017-05-15 22:24:38 +0200
commit7d0d482af79737f9b3f482bc958cf51ddfd9097e (patch)
tree1f0cbe902f43f1bebaf96d1dcd4023fe588335f2
parent85cdde904a67a7ae52c238d0f6b6e51ac132f8da (diff)
Add more autotest
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/hasflag-ref.siv7
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/hasflag.siv7
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/setflag-ref.siv7
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/setflag.siv7
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/test-date-ref.siv4
-rw-r--r--src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp2
6 files changed, 32 insertions, 2 deletions
diff --git a/src/ksieveui/autocreatescripts/autotests/data/hasflag-ref.siv b/src/ksieveui/autocreatescripts/autotests/data/hasflag-ref.siv
new file mode 100644
index 0000000..f8a1760
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/hasflag-ref.siv
@@ -0,0 +1,7 @@
+require "imap4flags";
+require "variables";
+
+#SCRIPTNAME: test1
+if hasflag :is "foo"
+{
+} \ No newline at end of file
diff --git a/src/ksieveui/autocreatescripts/autotests/data/hasflag.siv b/src/ksieveui/autocreatescripts/autotests/data/hasflag.siv
new file mode 100644
index 0000000..862e9d4
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/hasflag.siv
@@ -0,0 +1,7 @@
+require "imapflags";
+
+#SCRIPTNAME: test1
+if hasflag :is "foo"
+{
+}
+
diff --git a/src/ksieveui/autocreatescripts/autotests/data/setflag-ref.siv b/src/ksieveui/autocreatescripts/autotests/data/setflag-ref.siv
new file mode 100644
index 0000000..8bb2f57
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/setflag-ref.siv
@@ -0,0 +1,7 @@
+if header :is "Sender" "[email protected]"
+{
+ set "MyFlags" "\\Flagged $Work";
+ # Message will have both "\Flagged" and $Work flags
+ keep :flags "${MyFlags}";
+}
+
diff --git a/src/ksieveui/autocreatescripts/autotests/data/setflag.siv b/src/ksieveui/autocreatescripts/autotests/data/setflag.siv
new file mode 100644
index 0000000..8bb2f57
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/setflag.siv
@@ -0,0 +1,7 @@
+if header :is "Sender" "[email protected]"
+{
+ set "MyFlags" "\\Flagged $Work";
+ # Message will have both "\Flagged" and $Work flags
+ keep :flags "${MyFlags}";
+}
+
diff --git a/src/ksieveui/autocreatescripts/autotests/data/test-date-ref.siv b/src/ksieveui/autocreatescripts/autotests/data/test-date-ref.siv
index 1f9c6c9..936cfc5 100644
--- a/src/ksieveui/autocreatescripts/autotests/data/test-date-ref.siv
+++ b/src/ksieveui/autocreatescripts/autotests/data/test-date-ref.siv
@@ -3,9 +3,9 @@ require "imap4flags";
#SCRIPTNAME: test-date
#Script name: test-date
-if allof (date :is "header" "iso8601" "Sunday, 14 May 2017"
+if allof (date :is "header" "iso8601" "Monday, 15 May 2017"
, not date :matches "header" "hour" "08"
-, not date :contains "header" "julian" "Sunday, 14 May 2017"
+, not date :contains "header" "julian" "Monday, 15 May 2017"
)
{
keep;
diff --git a/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp b/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
index 8838efa..dcffb1a 100644
--- a/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
+++ b/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
@@ -156,6 +156,8 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data()
QTest::newRow("regexp") << QStringLiteral("regexp") << true << true;
QTest::newRow("comparator") << QStringLiteral("comparator") << false << true;
QTest::newRow("test-comment") << QStringLiteral("test-comment") << false << true;
+ QTest::newRow("hasflag") << QStringLiteral("hasflag") << false << true;
+ QTest::newRow("setflag") << QStringLiteral("setflag") << false << true;
}
QTEST_MAIN(SieveEditorGraphicalModeWidgetTest)