File: execute.svtest

package info (click to toggle)
dovecot 1:2.2.13-12~deb8u4
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 38,792 kB
  • sloc: ansic: 341,472; sh: 16,920; makefile: 5,393; cpp: 1,474; perl: 265; xml: 44; python: 34; pascal: 27
file content (92 lines) | stat: -rw-r--r-- 1,608 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
require "vnd.dovecot.testsuite";
require "fileinto";
require "imap4flags";
require "relational";
require "comparator-i;ascii-numeric";
require "mailbox";

test_set "message" text:
From: Henry von Flockenstoffen <henry@example.com>
To: Dieter von Ausburg <dieter@example.com>
Subject: Test message.

Test message.
.
;

test "Mark / Unmark" {
	if not test_script_compile "execute/mark.sieve" {
		test_fail "script compile failed";
	}

	if not test_script_run {
		test_fail "script execute failed";
	}

	if not test_result_execute {
		test_fail "failed to execute first result";
	}

	test_result_reset;

	test_message :folder "Marked" 0;

	if not hasflag "\\flagged" {
		test_fail "message not marked";
	}

	test_result_reset;

	test_message :folder "Unmarked" 0;

	if hasflag "\\flagged" {
		test_fail "message not unmarked";
	}
}

test_result_reset;
test "Setflag / Addflag / Removeflag" {
	if not test_script_compile "execute/flags.sieve" {
		test_fail "script compile failed";
	}

	if not test_script_run {
		test_fail "script execute failed";
	}

	if not test_result_execute {
		test_fail "failed to execute first result";
	}

	test_result_reset;

	test_message :folder "Set" 0;

	if not hasflag "\\draft" {
		test_fail "flag not set";
	}

	test_result_reset;

	test_message :folder "Add" 0;

	if not hasflag "\\draft" {
		test_fail "flag not retained";
	}

	if not hasflag "\\flagged" {
		test_fail "flag not added";
	}

	test_result_reset;

	test_message :folder "Remove" 0;

	if not hasflag "\\flagged" {
		test_fail "flag not retained";
	}

	if hasflag "\\draft" {
		test_fail "flag not removed";
	}
}