summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-05-16 07:34:23 +0200
committerMontel Laurent <[email protected]>2017-05-16 07:34:23 +0200
commitae5d13cf86a5b10da43104a26aa6bcdc546d861a (patch)
tree0c8dc32651ab459fb5ed642171fbfd239cf0c5fb
parent219e5cd8c2bc485172e182278a74ce7118b688ee (diff)
Add test about str with "<" which breaks parsing
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char-ref.siv2
-rw-r--r--src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char.siv2
-rw-r--r--src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp2
3 files changed, 6 insertions, 0 deletions
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
new file mode 100644
index 0000000..ccd33ff
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char-ref.siv
@@ -0,0 +1,2 @@
+# < create a problem during parsing
+addheader "X-Sieve-Filtered" "<[email protected]>";
diff --git a/src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char.siv b/src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char.siv
new file mode 100644
index 0000000..ccd33ff
--- /dev/null
+++ b/src/ksieveui/autocreatescripts/autotests/data/problem-with-inferior-char.siv
@@ -0,0 +1,2 @@
+# < 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 b0caae2..1ea29aa 100644
--- a/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
+++ b/src/ksieveui/autocreatescripts/autotests/sieveeditorgraphicalmodewidgettest.cpp
@@ -94,6 +94,7 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts()
QEXPECT_FAIL("regexp", "Expected failure on regexp file. Problem with header + comparator", Continue);
QEXPECT_FAIL("test-current-date", "Expected failure on current-date file. We depend against current date", Continue);
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);
QCOMPARE(proc.exitCode(), 0);
}
}
@@ -161,6 +162,7 @@ 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;
+ QTest::newRow("problem-with-inferior-char") << QStringLiteral("problem-with-inferior-char") << false << true;
}
QTEST_MAIN(SieveEditorGraphicalModeWidgetTest)