summaryrefslogtreecommitdiffstats
path: root/pigeonhole/tests/extensions/mailbox/errors.svtest
blob: 0821f5212203b97158b8f42c8bef8d31d90bc6e4 (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
require "vnd.dovecot.testsuite";
require "variables";
require "vnd.dovecot.debug";

require "relational";
require "comparator-i;ascii-numeric";

/*
 * Invalid syntax
 */

test "Invalid Syntax" {
	if test_script_compile "errors/syntax.sieve" {
		test_fail "compile should have failed";
	}

	# FIXME: check warnings
	if not test_error :count "eq" :comparator "i;ascii-numeric" "12" {
		test_fail "wrong number of errors reported";
	}
}

/*
 * Mailboxexists - bad UTF-8 in mailbox name
 */

test "Mailboxexists - bad UTF-8 in mailbox name" {
	if not test_script_compile "errors/mailboxexists-bad-utf8.sieve" {
		test_fail "compile failed";
	}

	if not test_script_run {
		test_fail "execution failed";
	}

	# FIXME: check warnings
	if not test_error :count "eq" :comparator "i;ascii-numeric" "0" {
		test_fail "wrong number of runtime errors reported";
	}
}