summaryrefslogtreecommitdiffstats
path: root/pigeonhole/tests/extensions/special-use/execute.svtest
blob: a2b637e3838191218e0c863fc0032b04fec44fda (plain)
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
require "vnd.dovecot.testsuite";
require "special-use";
require "fileinto";
require "variables";

test "Specialuse_exists - None exist" {
	if specialuse_exists "\\Sent" {
		test_fail "specialuse_exists confirms existence of unassigned special-use flag";
	}
}

test "Specialuse_exists <MAILBOX> - None exist" {
	if specialuse_exists "INBOX" "\\Sent" {
		test_fail "specialuse_exists confirms existence of unassigned special-use flag";
	}
}

test_mailbox_create "frop";
test_mailbox_create "friep";

test ":specialuse" {
	test_set "message" text:
From: stephan@example.org
To: nico@frop.example.org
Subject: Frop 1

Frop!
.
	;

	fileinto :specialuse "\\Junk" "frop";

	if not test_result_execute {
		test_fail "execution of result failed";
	}
}

test ":specialuse variable" {
	test_set "message" text:
From: stephan@example.org
To: nico@frop.example.org
Subject: Frop 1

Frop!
.
	;

	set "use" "\\Junk";
	fileinto :specialuse "${use}" "frop";

	if not test_result_execute {
		test_fail "execution of result failed";
	}
}