From 75233d72a676fcd698e6c97365771d12f044ac33 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Sat, 16 Aug 2008 20:47:26 +0200
Subject: [PATCH] Forgot to add test file.

---
 tests/extensions/body/match-values.svtest | 55 +++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 tests/extensions/body/match-values.svtest

diff --git a/tests/extensions/body/match-values.svtest b/tests/extensions/body/match-values.svtest
new file mode 100644
index 000000000..87e11177e
--- /dev/null
+++ b/tests/extensions/body/match-values.svtest
@@ -0,0 +1,55 @@
+require "vnd.dovecot.testsuite";
+
+require "body";
+require "variables";
+
+test_set "message" text:
+From: stephan@rename-it.nl
+To: s.bosch@utwente.nl
+Subject: Body test
+
+The big bad body test.
+.
+;
+
+# Test whether body test ignores match values
+test "Match values disabled" {
+	if not body :raw :matches "The * bad * test*" {
+		test_fail "should have matched";
+	}
+
+	if anyof (
+		string :is "${1}" "big",
+		string :is "${2}" "body",
+		not string :is "${0}" "",
+		not string :is "${1}" "",
+		not string :is "${2}" "") {
+		test_fail "match values not disabled";
+	}
+}
+
+test "Match values re-enabled" {
+	if not header :matches "from" "*@*" {
+		test_fail "should have matched";
+	}
+
+	if anyof (
+		not string :is "${0}" "stephan@rename-it.nl",
+		not string :is "${1}" "stephan",
+		not string :is "${2}" "rename-it.nl" ) {
+		test_fail "match values not re-enabled properly.";
+	}
+}
+
+test "Match values retained" {
+	if not body :raw :matches "The * bad * test*" {
+		test_fail "should have matched";
+	}
+
+	if anyof (
+		not string :is "${0}" "stephan@rename-it.nl",
+		not string :is "${1}" "stephan",
+		not string :is "${2}" "rename-it.nl" ) {
+		test_fail "match values not retained after body test.";
+	}
+}
-- 
GitLab