File: actions.svtest

package info (click to toggle)
dovecot 1%3A2.2.33.2-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports-sloppy
  • size: 50,420 kB
  • sloc: ansic: 449,977; sh: 9,653; makefile: 6,792; cpp: 1,557; perl: 295; python: 73; xml: 44; pascal: 27
file content (80 lines) | stat: -rw-r--r-- 1,680 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
require "vnd.dovecot.testsuite";
require "relational";
require "comparator-i;ascii-numeric";

test_set "message" text:
To: nico@frop.example.org
From: stephan@example.org
Subject: Test

Test.
.
;

test_mailbox_create "INBOX.VB";
test_mailbox_create "INBOX.backup";

test "Fileinto" {
	if not test_script_compile "actions/fileinto.sieve" {
		test_fail "script compile failed";
	}

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

	if not test_result_action :count "eq" :comparator "i;ascii-numeric" "3" {
		test_fail "wrong number of actions in result";
	}

	if not test_result_action :index 1 "store" {
		test_fail "first action is not 'store'";
	}

	if not test_result_action :index 2 "store" {
		test_fail "second action is not 'store'";
	}

	if not test_result_action :index 3 "keep" {
		test_fail "third action is not 'keep'";
	}

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

test "Redirect" {
	if not test_script_compile "actions/redirect.sieve" {
		test_fail "compile failed";
	}

	if not test_script_run {
		test_fail "execute failed";
	}

	if not test_result_action :count "eq" :comparator "i;ascii-numeric" "4" {
		test_fail "wrong number of actions in result";
	}

	if not test_result_action :index 1 "redirect" {
		test_fail "first action is not 'redirect'";
	}

	if not test_result_action :index 2 "keep" {
		test_fail "second action is not 'keep'";
	}

	if not test_result_action :index 3 "redirect" {
		test_fail "third action is not 'redirect'";
	}

	if not test_result_action :index 4 "redirect" {
		test_fail "fourth action is not 'redirect'";
	}

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