summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-05-16 21:29:30 +0200
committerMontel Laurent <[email protected]>2017-05-16 21:29:30 +0200
commit6c2fdf6f8e89b7e199854595faeb7655bc1e4c48 (patch)
tree28b5c93fcc5712b5dc7777e8287715167af14eda
parenta468718c011fd3cb28533e4d75a12dce93f9d321 (diff)
Add more autotest
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/foreverypart-ref.siv12
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/foreverypart.siv12
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char-ref.siv5
-rw-r--r--src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp4
4 files changed, 31 insertions, 2 deletions
diff --git a/src/ksieveui/autocreatescripts/autotests/data/foreverypart-ref.siv b/src/ksieveui/autocreatescripts/autotests/data/foreverypart-ref.siv
new file mode 100644
index 0000000..31d0069
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/foreverypart-ref.siv
@@ -0,0 +1,12 @@
+foreverypart :name "dd"
+ {
+ if allof (
+ header :mime :param "filename" :contains
+ "Content-Disposition" "important",
+ header :mime :subtype "Content-Type" "pdf",
+ size :over "100K")
+ {
+ fileinto "INBOX.important";
+ break;
+ }
+ }
diff --git a/src/ksieveui/autocreatescripts/autotests/data/foreverypart.siv b/src/ksieveui/autocreatescripts/autotests/data/foreverypart.siv
new file mode 100644
index 0000000..31d0069
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/foreverypart.siv
@@ -0,0 +1,12 @@
+foreverypart :name "dd"
+ {
+ if allof (
+ header :mime :param "filename" :contains
+ "Content-Disposition" "important",
+ header :mime :subtype "Content-Type" "pdf",
+ size :over "100K")
+ {
+ fileinto "INBOX.important";
+ break;
+ }
+ }
diff --git a/src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char-ref.siv b/src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char-ref.siv
index ccd33ff..dfcc063 100644
--- a/src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char-ref.siv
+++ b/src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char-ref.siv
@@ -1,2 +1,5 @@
-# < create a problem during parsing
+require "editheader";
+
+#SCRIPTNAME: Script part 0
+# " create a problem during parsing
addheader "X-Sieve-Filtered" "<[email protected]>";
diff --git a/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp b/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
index d33c418..5e46e9c 100644
--- a/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
+++ b/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
@@ -96,6 +96,7 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts()
QEXPECT_FAIL("test-date", "Expected failure on date file. We depend against current date", Continue);
QEXPECT_FAIL("problem-with-inferior-char", "Expected failure on problem-with-inferior-char file. \"<\" is start of tag... => it will create problem", Continue);
QEXPECT_FAIL("delete-headers-with-index", "Expected failure on delete-headers-with-index file. We depend against \"index\" feature", Continue);
+ QEXPECT_FAIL("foreverypart", "Expected failure on foreverypart file. A lot of parsing errors.", Continue);
QCOMPARE(proc.exitCode(), 0);
}
}
@@ -163,13 +164,14 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts_data()
QTest::newRow("hasflag") << QStringLiteral("hasflag") << false << true;
QTest::newRow("setflag") << QStringLiteral("setflag") << false << true;
QTest::newRow("add-header") << QStringLiteral("add-header") << false << true;
- //We need to fix it
QTest::newRow("problem-with-inferior-char") << QStringLiteral("problem-with-inferior-char") << false << true;
//We need to implement index support
QTest::newRow("delete-headers-with-index") << QStringLiteral("delete-headers-with-index") << true << true;
QTest::newRow("notify-2") << QStringLiteral("notify-2") << false << true;
+
+ QTest::newRow("foreverypart") << QStringLiteral("foreverypart") << true << true;
}
QTEST_MAIN(SieveEditorGraphicalModeWidgetTest)