1
require "vnd.dovecot.testsuite";
3
test_set "message" text:
4
From: stephan@rename-it.nl
15
test_fail "executed wrong alternative";
21
test_fail "executed wrong alternative";
27
test_fail "executed wrong alternative (if)";
30
test_fail "executed wrong alternative (else)";
36
test_fail "executed wrong alternative (if)";
38
test_fail "executed wrong alternative (elsif)";
43
test "IF-address-true" {
44
if address :is "from" "stephan@rename-it.nl" {
46
test_fail "executed wrong alternative";
50
test "IF-address-false" {
51
if address :is "from" "tss@iki.fi" {
52
test_fail "executed wrong alternative";
56
test "ELSEIF-address-true" {
57
if address :is "from" "tss@iki.fi" {
58
test_fail "executed wrong alternative (if)";
59
} elsif address :is "from" "stephan@rename-it.nl" {
61
test_fail "executed wrong alternative (else)";
65
test "ELSEIF-address-false" {
66
if address :is "from" "tss@iki.fi" {
67
test_fail "executed wrong alternative (if)";
68
} elsif address :is "to" "stephan@rename-it.nl" {
69
test_fail "executed wrong alternative (elsif)";
74
test "IF-nesting-static" {
78
test_fail "chose wrong outcome: true->true->false";
82
test_fail "chose wrong outcome: true->false";
86
test_fail "chose wrong outcome: false->true->false";
88
test_fail "chose wrong outcome: false->true->true";
91
test_fail "chose wrong outcome: false->false";
95
test "ALLOF-ANYOF-static" {
96
if allof ( true, true, true, true, anyof (false, false, true, false) ) {
97
if anyof( allof(false, false), allof(false, true), allof(true, false) ) {
98
test_fail "chose wrong outcome: true->true";
99
} elsif allof( anyof(false, true), true, anyof(true, false), anyof(true, true)) {
102
test_fail "chose wrong outcome: true->false->false";
105
test_fail "chose wrong outcome: false";
109
test "ALLOF-ANYOF-single" {
111
if not allof ( true ) {
112
test_fail "allof ( true ) evaluates to false";
116
test_fail "allof ( false ) evaluates to true";
119
if not anyof ( true ) {
120
test_fail "anyof ( true ) evaluates to false";
124
test_fail "anyof ( false ) evaluates to true";
128
if not allof ( exists "subject" ) {
129
test_fail "allof ( 'true' ) evaluates to false";
132
if allof ( exists "x-nonsense" ) {
133
test_fail "allof ( 'false' ) evaluates to true";
136
if not anyof ( exists "subject" ) {
137
test_fail "anyof ( 'true' ) evaluates to false";
140
if anyof ( exists "x-nonsense" ) {
141
test_fail "anyof ( 'false' ) evaluates to true";
147
test_fail "continued after stop";