File: testsuite.svtest

package info (click to toggle)
dovecot 1%3A2.2.27-3%2Bdeb9u2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 48,520 kB
  • sloc: ansic: 430,475; sh: 17,438; makefile: 6,587; cpp: 1,557; perl: 295; python: 67; xml: 44; pascal: 27
file content (75 lines) | stat: -rw-r--r-- 1,541 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
require "vnd.dovecot.testsuite";
require "envelope";

/* Test message environment */

test "Message Environment" {
	test_set "message" text:
From: sirius@example.org
To: nico@frop.example.com
Subject: Frop!

Frop!
.
	;

	if not header :contains "from" "example.org" {
		test_fail "message data not set properly.";
	}

	test_set "message" text:
From: nico@frop.example.com
To: stephan@nl.example.com
Subject: Friep!

Friep!
.
	;

	if not header :is "from" "nico@frop.example.com" {
    	test_fail "message data not set properly.";
	}

	keep;
}

/* Test envelope environment */

test "Envelope Environment" {
	test_set "envelope.from" "stephan@hutsefluts.example.net";

	if not envelope :is "from" "stephan@hutsefluts.example.net" {
		test_fail "envelope.from data not set properly (1).";
	}

	test_set "envelope.to" "news@example.org";

	if not envelope :is "to" "news@example.org" {
		test_fail "envelope.to data not set properly (1).";
	}

	test_set "envelope.auth" "sirius";

	if not envelope :is "auth" "sirius" {
		test_fail "envelope.auth data not set properly (1).";
	}

	test_set "envelope.from" "stephan@example.org";

	if not envelope :is "from" "stephan@example.org" {
		test_fail "envelope.from data not reset properly (2).";
	}

	test_set "envelope.to" "past-news@example.org";

	if not envelope :is "to" "past-news@example.org" {
		test_fail "envelope.to data not reset properly (2).";
	}

	test_set "envelope.auth" "zilla";

	if not envelope :is "auth" "zilla" {
		test_fail "envelope.auth data not reset properly (2).";
	}
}